FAQ: What are the performance benefits over using GM?
Clone this wiki locally
This is a list of performance gains of Scriptish over Greasemonkey.
- Error Handling: The code behind error handling has been greatly simplified.
API Refinements: Various refinements have been made to the
GM_API. For example,
GM_registerMenuCommandno longer attempts to run against iframes.
- Asynchronous file operations: Scriptish writes the config and blocklist files asynchronously (i.e. off of the main thread), unlike Greasemonkey. Scriptish also reads modified scripts asynchronously, improving browser responsiveness.
- Config stored as JSON: JSON is faster to parse and create than XML, which is what Greasemonkey uses.
- No Add-ons Manager Proxy Scripts: Scriptish uses one array of scripts, which is shared with the Add-ons Manager. Greasemonkey, on the other hand, keeps an extra array of proxy scripts for the Add-ons Manager, requiring extra work to ensure the proxy objects are updated when a script is updated and vice versa.
- Goodbye Old Browsers: Code supporting old versions of Firefox (i.e. before Firefox 4) has been removed. By simplifying the code base, performance gains have been achieved.
Toolbar Button: Greasemonkey listens to every
DOMNodeRemovedon every browser window in order to support its toolbar button. Scriptish does not require such listeners due to its superior toolbar button implementation.
- "Enabled" Checking: Greasemonkey checks the value of its "enabled" preference whenever a page loads. Scriptish, however, caches its "enabled" value, avoiding unnecessary lookups.
- Reduced, merged & cached
@excluderegular expressions (instead of being simply memoizing them, which GM does).
- Script contents are cached in memory after first use, greatly reducing the time required to inject user scripts. This approach increases memory usage, and is therefore optional (see Manual: Preferences).
GM_API resources are not created until they are needed.
- User scripts are not wrapped by default.
- The code to utilize the Firebug console has been greatly reduced.
- Scripts have greater control over when they load through the use of the advanced
@delaymetadata block headers.
- Scriptish does not use a start-up listener. Greasemonkey, however, utilizes a start-up listener which has to load an instance of each of its XPCOM component helpers.
- Conditional logic for Greasemonkey version changes has been removed.
- Greasemonkey provides a "sort by execution order" option. In order to support this sorting feature they must execute a good deal of code to add menu items, add the sort by option, and perform various other tasks which are unnecessary in Scriptish.