THIS IS A STATIC MIRROR OF USERSCRIPTS.ORG - LOGINS DO NOT WORK

Lowering GreaseMonkey's CPU usage

Written by ©TriMoon™ — Last update Oct 28, 2011

9 points

Table of contents:


Intro:

I noticed that using global excludes in GreaseMonkey, considerably lowers CPU usage because it won't run on those pages!
This seems to be even more efficient as the excludes used per-userscript!
You can use this script to aid testing entries: FB GM run logger

Facebook:

Using the entries below i was able to cut-down CPU usage on Facebook by more than 25%!

RegExpr version:

Global excludes for Facebook:
/^https?:\/\/creative\.ak\.fbcdn\.(com|net)\//
/^https?:\/\/external\.ak\.fbcdn\\.(com|net)\//
/^https?:\/\/photos-\w+\.ak\.fbcdn\.(com|net)\//
/^https?:\/\/platform\.ak\.fbcdn\.(com|net)\//
/^https?:\/\/profile\.ak\.fbcdn\.(com|net)\//
/^https?:\/\/(\w+\.)*static\.ak\.fbcdn\.(com|net)\//
/^https?:\/\/((\w+\.)*)\w+\.channel\.facebook\.(com|net)\//
/^https?:\/\/apps\.facebook\.(com|net)\//
/^https?:\/\/error\.facebook\.(com|net)\//
/^https?:\/\/(\w+\.)*static\.facebook\.(com|net)\//
/^https?:\/\/\w+\.facebook\.(com|net)\/\w+\/posts\//
/^https?:\/\/\w+\.facebook\.(com|net)\/ai/
/^https?:\/\/\w+\.facebook\.(com|net)\/ajax/
/^https?:\/\/\w+\.facebook\.(com|net)\/campaign/
/^https?:\/\/\w+\.facebook\.(com|net)\/dialog/
/^https?:\/\/\w+\.facebook\.(com|net)\/editaccount/
/^https?:\/\/\w+\.facebook\.(com|net)\/editprofile/
/^https?:\/\/\w+\.facebook\.(com|net)\/extern/
/^https?:\/\/\w+\.facebook\.(com|net)\/friends/
/^https?:\/\/\w+\.facebook\.(com|net)\/groups/
/^https?:\/\/\w+\.facebook\.(com|net)\/help/
/^https?:\/\/\w+\.facebook\.(com|net)\/home\.php\?sk=group_/
/^https?:\/\/\w+\.facebook\.(com|net)\/login/
/^https?:\/\/\w+\.facebook\.(com|net)\/logout/
/^https?:\/\/\w+\.facebook\.(com|net)\/notifications/
/^https?:\/\/\w+\.facebook\.(com|net)\/plugins/
/^https?:\/\/\w+\.facebook\.(com|net)\/posted/
/^https?:\/\/\w+\.facebook\.(com|net)\/reqs/
/^https?:\/\/\w+\.facebook\.(com|net)\/settings/
Easy setup:
Open a new tab and type: about:config
Locate the key: greasemonkey.globalExcludes,
Then right-click it to modify it's value to the code below, by copying ALL code inside the gray area.
Then restart your browser to make GreaseMonkey recognize and use this new value.
[
"/^https?:\\/\\/creative\\.ak\\.fbcdn\\.(com|net)\\//",
"/^https?:\\/\\/external\\.ak\\.fbcdn\\.(com|net)\\//",
"/^https?:\\/\\/photos-\\w+\\.ak\\.fbcdn\\.(com|net)\\//",
"/^https?:\\/\\/platform\\.ak\\.fbcdn\\.(com|net)\\//",
"/^https?:\\/\\/profile\\.ak\\.fbcdn\\.(com|net)\\//",
"/^https?:\\/\\/(\\w+\\.)*static\\.ak\\.fbcdn\\.(com|net)\\//",
"/^https?:\\/\\/((\\w+\\.)*)\\w+\\.channel\\.facebook\\.(com|net)\\//",
"/^https?:\\/\\/apps\\.facebook\\.(com|net)\\//",
"/^https?:\\/\\/error\\.facebook\\.(com|net)\\//",
"/^https?:\\/\\/(\\w+\\.)*static\\.facebook\\.(com|net)\\//",
"/^https?:\\/\\/\\w+\\.facebook\\.(com|net)\\/\\w+\\/posts\\//",
"/^https?:\\/\\/\\w+\\.facebook\\.(com|net)\\/ai/",
"/^https?:\\/\\/\\w+\\.facebook\\.(com|net)\\/ajax/",
"/^https?:\\/\\/\\w+\\.facebook\\.(com|net)\\/campaign/",
"/^https?:\\/\\/\\w+\\.facebook\\.(com|net)\\/dialog/",
"/^https?:\\/\\/\\w+\\.facebook\\.(com|net)\\/editaccount/",
"/^https?:\\/\\/\\w+\\.facebook\\.(com|net)\\/editprofile/",
"/^https?:\\/\\/\\w+\\.facebook\\.(com|net)\\/extern/",
"/^https?:\\/\\/\\w+\\.facebook\\.(com|net)\\/friends/",
"/^https?:\\/\\/\\w+\\.facebook\\.(com|net)\\/groups/",
"/^https?:\\/\\/\\w+\\.facebook\\.(com|net)\\/help/",
"/^https?:\\/\\/\\w+\\.facebook\\.(com|net)\\/home\\.php\\?sk=group_/",
"/^https?:\\/\\/\\w+\\.facebook\\.(com|net)\\/login/",
"/^https?:\\/\\/\\w+\\.facebook\\.(com|net)\\/logout/",
"/^https?:\\/\\/\\w+\\.facebook\\.(com|net)\\/notifications/",
"/^https?:\\/\\/\\w+\\.facebook\\.(com|net)\\/plugins/",
"/^https?:\\/\\/\\w+\\.facebook\\.(com|net)\\/posted/",
"/^https?:\\/\\/\\w+\\.facebook\\.(com|net)\\/reqs/",
"/^https?:\\/\\/\\w+\\.facebook\\.(com|net)\\/settings/"
]

Contributors:


Suggestions:

Feel free to post suggestions for improvements as comments :)
If you give a negative rating then please give feedback in comments explaining the reason, so i can improve!

Scripts mentioned in guide

Users mentioned in guide