Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm a heavy Firefox user with many add-ons. I also use some userscripts via Scriptish.

I found some Firefox extensions that offer both the userscript and add-on version like A Bit Better RTM.

Is it better to use the userscript version over the add-on version or vice-versa? I'm concerned about memory usage and performance.

share|improve this question
Most Firefox addons are just Javascript codes that has more access. You're probably better off using user scripts because the memory they use are normally released when the tab is closed, which can't be said for add-ons. Also, the address matching system in user script addons may be more efficient if you use lots of scripts. – Sep 23 '11 at 19:39
Thanks, you said that the userscripts only loads in a matching website (This is a good element to choice the userscript version), but you know if the memory of the userscript is equal or less than the addon? – izazueta Sep 26 '11 at 17:12
This largely depends on how the script/add-ons are written. I would say user scripts may be slightly less memory efficient because they cannot use the optimizations achievable through APIs that are only available to add-ons. For example, user scripts can't normally share objects between tabs so they must recreate them inside each tab. On the other hand, the independent objects are guaranteed to be deleted on tab close. – Sep 26 '11 at 17:20
Thanks – izazueta Oct 6 '11 at 23:02
up vote 2 down vote accepted

It depends on the addon, like mentioned, but assuming that there is no advantage to using a addon (which is normally the case, and when it is not it requires code modifications that a user script author is unlikely to do in order to take advantage of the addon perks), then I would say using a regular user script (at least with Scriptish) is always faster, for the following reasons:

  1. User scripts are lazy loaded (in Scriptish), so they are not loaded until they are first needed. Also the resources are lazy loaded. So adding a user script won't effect your FF startup time as a addon would. You can also disable caching if you have a fast HD and want to save some memory (usually the case for mobile).
  2. If you have 2+ addons that you could have installed as user scripts then you are already asking your computer to duplicate functionality that it is already doing. Such as listening to page loads, and loading instructions/code. Also more HD space will be used, because each addon will have copies of the same code, which is built in to Scriptish.
  3. With Scriptish you can list globally excludes, user script specific excludes, and even disable/enable any protocol that you want to, which you won't be able to do with a addon, or if you could then you would have to do it for all addons individually, so what's the point?
  4. Sometimes the order in which user scripts are applied matters, and this can be managed by Scriptish using the @priority header, which a addon would not be able to use because it would not have any idea when it is doing a injection relative to the other addons making modifications to the page.
  5. A addon will need to be updated more often because it will need to ship the updates for code that is built in to Scriptish, and the updates for the addon itself. Whereas a user script only needs to send updates for the user script.

If I think of any more then I will add them to the list..

share|improve this answer
Ok thanks @erikvold – izazueta Oct 6 '11 at 23:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .