1/20/2024 0 Comments Improve firefox startup timeAdd-ons can have extra features that are only available depending on user preferences, and others have most of their features depend on a user being logged in to a service. Do not load or run code before it’s needed.OK, so now let’s get to the real meat of this post: what can extension developers do to improve startup performance in their add-ons? Here are my recommendations: This is something I should have done long ago. I hope to release 1.4.5 very soon now that I see the significant difference that it will make to thousands of users. There are still some fine-tuning to do that will probably reduce that number a little more. The new build was adding only 57 ms to startup time, about 8% of overhead. So, with this new motivation, I spent some time rethinking the startup flow (quite a headache for this particular add-on), and after making it work I ended up with this:įirefox 3.6.4, with Fire.fm 1.4.5 (dev): 760 ms Making the simplest of changes had produced a very clear difference, and I still wasn’t done. Startup time was down to 800 ms! I didn’t expect that at all. When I was done with that, I decided to take a break before tackling the more difficult tasks, and I decided to test again. I began with the easy ones, which basically consisted on loading a number of modules and variables only until they were needed. I had several ideas on what I should fix, and the one that I though would help the most involved changing the startup flow significantly, so I left that one for last. 5 add-ons like Fire.fm in a user’s profile would probably increase startup time more than one second! It was unacceptable. So, the latest version of my add-on added more than 210 ms to startup time, an increase of about 30%. I tested on Mac OS X 10.6.3, and my testing produced these figures:įirefox 3.6.4, with Fire.fm 1.4.4: 919.2 ms Measuring Startup provides a very easy method. I thought I could shave off a few milliseconds, but not much more.įirst, I needed a testing environment. I knew that there were several areas for improvement, but I was skeptical about the real impact those improvements would have. Case Study: Fire.fmįire.fm is not the most complex of add-ons, but it does have a wide variety of features and some very complex flows and logic. I spent the weekend working on it, and the results were very surprising. I also realized that I was just as guilty with my add-on, and that I needed to work on improving its startup performance. After a while some patterns began emerging, and I realized that improving startup performance for extensions is not very hard, and can be summed up as a couple of simple guidelines. Since I didn’t want to just tell authors to “see what you can do”, I spent some time analyzing their code to identify the most probable reasons for the slowdowns. I spent some time last week contacting the authors of the add-ons with the most impact on startup times, and the response has been very positive so far. But for the moment we’ll be doing things by hand. We think this system should eventually be integrated into AMO, so that we can have a performance dashboard that allows authors to compare their own add-on performance to a global average, or maybe a series of standards we set. We should care about add-on performance, and very soon we’ll have to.ĭietrich began the add-on performance conversation with his post Firefox, Extensions and Performance, and now with the help of Heather Arthur, we have a modified Talos system measuring the startup performance for the most popular extensions. But once you have 5 or 6 add-ons installed, you realize how their combined weight can be very detrimental to user experience. I know that when I test my add-on in my test profile, the slowdown is almost imperceptible. Performance hasn’t really been a big concern for add-on authors. Having a large history and bookmarks database can slow things down a bit, but I think we all know why many of us wait multiple seconds for Firefox to open: add-ons. If you download and install Firefox and run it on a clean profile, it should open quickly and be very responsive. Firefox 3.6 was already a significant improvement over 3.5, and Firefox 4 promises to be lightning fast. Mozilla is fighting poor performance in Firefox on many fronts.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |