Confirmed users
945
edits
(Correct MDN link) |
|||
| (4 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
This page has MOVED to MDN: | |||
[https://developer.mozilla.org/en/Extensions/Performance_best_practices_in_extensions MDN: Performance Best Practices in Extensions] | |||
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. | ||
==Use JavaScript Modules== | ==Use JavaScript Modules== | ||
| Line 116: | Line 115: | ||
==apng/agif inappropriate in a lot of cases== | ==apng/agif inappropriate in a lot of cases== | ||
Animations require a lot of time to set up ( | Animations require a lot of time to set up, as a lot of images are decoded (the frames). | ||
nsITree/<tree> seems to be extra special in this regard, as it seem to | Animated images may have their cached representations evicted quite often, causing the frames of your animated images to be reloaded lots of times, not just once. | ||
nsITree/<tree> seems to be extra special in this regard, as it doesn't seem to | |||
cache animations at all under certain circumstances. | |||
==base64/md5/sha1 implementations== | ==base64/md5/sha1 implementations== | ||
Do not ship own base64/md5/sha1 implementations. | Do not ship your own base64/md5/sha1 implementations. Regarding base64 there are the built-in atob/btoa functions that do the job just well and are available in overlay script as well as in in js modules and components. Hashes can be computed using nsICryptoHash, which accepts either a string or an nsIInputStream. See the [https://developer.mozilla.org/en/nsICryptoHash MDC documentation for nsICryptoHash] | ||
==Image sprites== | ==Image sprites== | ||
| Line 136: | Line 136: | ||
This effectively means that javascript extensions cannot use the nsIThread API anymore to execute own jobs on different threads than the main thread. | This effectively means that javascript extensions cannot use the nsIThread API anymore to execute own jobs on different threads than the main thread. | ||
Consider Web/ChromeWorker as a replacement, which are severely limited in what you can do with them, or just don't use threads. | Consider Web/ChromeWorker as a replacement, which are severely limited in what you can do with them, or just don't use threads. | ||