Skip to content

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.

General

  1. 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.
  2. Error Handling: The code behind error handling has been greatly simplified.
  3. API Refinements: Various refinements have been made to the GM_ API. For example, GM_registerMenuCommand no longer attempts to run against iframes.
  4. 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..
  5. 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.

Script Loading

  1. Cached regular expressions (instead of being memoized).
  2. GM_ API resources are not created until they are needed.
  3. User scripts are not wrapped by default.
  4. The code to utilize the Firebug console has been greatly reduced.
  5. Scripts have greater control over when they load through the use of the @run-at and @delay metadata block headers.

Startup Performance

  1. 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.
  2. Through code improvements, Scriptish is a smaller, lighter extension.
  3. Conditional logic for Greasemonkey version changes has been removed.