Performance/Addons/BestPractices: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Created page with '{{draft}} A list of recommendations for add-on authors to help keep Firefox fast and responsive. ==Use JavaScript Modules== '''Instead of the <script> tag in overlays''' JavaS…')
 
No edit summary
Line 2: Line 2:


A list of recommendations for add-on authors to help keep Firefox fast and responsive.
A list of recommendations for add-on authors to help keep Firefox fast and responsive.
Once it matures, we'll move it over to MDC. Please contribute your tips!


==Use JavaScript Modules==
==Use JavaScript Modules==

Revision as of 01:09, 17 March 2010

Draft-template-image.png THIS PAGE IS A WORKING DRAFT Pencil-emoji U270F-gray.png
The page may be difficult to navigate, and some information on its subject might be incomplete and/or evolving rapidly.
If you have any questions or ideas, please add them as a new topic on the discussion page.

A list of recommendations for add-on authors to help keep Firefox fast and responsive.

Once it matures, we'll move it over to MDC. Please contribute your tips!

Use JavaScript Modules

Instead of the <script> tag in overlays JavaScript that is loaded via the script tag can slow window load. If your script is not needed as part of window setup, and doesn't need to be loaded for each individual window, then load it on-demand as a module.

Instead of JS XPCOM services JavaScript code modules are singletons, are fastloaded, and don't require XPCOM like a full-blown JS XPCOM service does.

Memoization

Lazily Load Services

Reduce File I/O

  • Use JARs!
  • Combine CSS
  • Combine pref files
  • Combine xpt files

Asynchronous I/O

Asynchronous SQL Queries

Generators