FAQ: What are the performance benefits over using GM?
erikvold edited this page Mar 13, 2011
·
32 revisions
This is a list of performance gains of Scriptish over Greasemonkey.
- JavaScript Modules (JSM): There is only one instance of each helper object, which is shared between all windows. This means Scriptish only loads code once, and only when needed. Compare this behavior to Greasemonkey, which creates a helper object instance for an XPCOM component, and then again for each window.
- 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_registerMenuCommand
no longer attempts to run against iframes. - No Addon Manager proxy scripts: Scriptish has one array of scripts which the Addon Manager also uses, GM on the other hand keeps a array of proxy scripts which the Addon Manager uses, which means there is a bunch of code in GM which makes sure that these 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.
- Cached regular expressions (instead of being memoized).
-
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
@run-at
and@delay
metadata 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 helpers for its XPCOM component.
- Through code improvements, Scriptish is a smaller, lighter extension.
- Conditional logic for Greasemonkey version changes has been removed.