-
Notifications
You must be signed in to change notification settings - Fork 436
[Firefox] Slow startup when compared to AdBlock Plus #520
Comments
Some observations:
Now that said, here is another case to test:
So it appears ABP is delaying the loading of its filters. However, this results in many unhappy users. For uBlock, I do not feel the need to delay loading the filters because:
And in both cases whatever ads will be blocked just fine on whatever tab is opened. So the delay will go away as soon as uBlock makes a selfie of itself. More about this here. Still, I have been thinking about further improving the loading/parsing of filter lists lately, and there might be some ideas which are worth exploring in the medium term. |
Also, it is important to note that the startup time may vary on many other factors like...
Here is quick rundown of startup times, not sure if a selfie is a created here or not...(captured in ms, from health report) run 1:below, opened 3 times (disabled uBlock,no addon) Personally i don't mind in delaying for another second or two, instead of slipping the ads and other when sites are loaded during start up. What the important thing here is, it should not hinder the loading performance in anyway, which uBlock does it best than anything else 👍 And happy to be back as a firefox user :) |
Where did you get these numbers? They are |
Yes. Each number denotes one start up time. So, 3-4 times i did started the browser and repeated it 4 tmes. |
At the moment uBlock doesn't slow down the home page loading anymore, maybe it uses the "selfie" now. However the slowdown was subtle but annoying when I installed the extension. |
As gorhill pointed out, ABP, as of recently, loads filters after start up. On the systems I use, this helped the start up time, but makes the browser unresponsive for a few seconds. Not to mention the loss of blocking which is annoying if someone uses another website for home page besides about:home. Adguard behaves in a similar fashion, appears to delay loading. In other words, placebo. Both sides of startup should be critically explored. There is no free lunch. |
That's the thing, no free lunch: we have to choose between instant load or not blocking ads on already opened tab. ABP chose instant load/delayed blocking, I will go with delayed load/instant blocking, given that eventually it will be instant load/instant blocking once a selfie is present. I will still want to look into improving further the load performance though. |
I think I will work on these load speed improvement ideas, they look more and more attractive to me, and they take care of one aspect of the selfie which bothers me a lot: a selfie is a all or nothing solution, i.e. uBlock loads virtually instantly when there is a selfie, or delayed when there is no selfie. Simply adding a single custom filter invalidate the whole selfie. This bothers me. I have in mind a solution that is more granular, and which can produce immediate results after the first install, and depending on result, maybe good enough to remove the need for selfie code. |
To give a different perspective on the "Slow startup when compared to AdBlock Plus" statement: |
Related: #498. |
This is just dev notes for myself. Default filter lists. Network filters:
Cosmetic filters:
|
Edit: New, more realistic benchmarks available at the bottom, now measuring timings for real browser launch, as opposed to merely disabling/enabling the extension. Also, only one "New tab" page is now used (I don't think this was the case here). |
Edit: New, more realistic benchmarks available at the bottom, now measuring timings for real browser launch, as opposed to merely disabling/enabling the extension. Also, only one "New tab" page is now used (I don't think this was the case here). This improvement will also benefit when filter lists have to be reloaded for various other reasons than just at launch: for example, changing selection of filter lists, modifying custom filters, reload following the auto-update of filter lists (the compilation will occur when the new version is received, not when the reload occurs). Bottom line, if there is a compiled version of a filter list, it loads faster. The cost of compiling a filter list is paid once, when the filter list is written to, and this cost is fully paid back starting at the second reload of the same filter list. |
I'm quite curious as to why Firefox is slower than Chromium in these tests - could you share what you are using for the benchmarking? Is it just logging a timestamp before and after µBlock.load(); in start.js? |
https://github.com/gorhill/uBlock/blob/master/src/js/profiler.js I wrap all the code in
Then in
|
@chrisaljoudi can we change the storage quota on Safari to be more in line with the one for Firefox? (~100 MB). Just to err on the safe side. |
Going to be running realistic benchmarks, i.e. really launching the browsers, as opposed to merely disabling/enabling the extension. |
@gorhill just as an interesting datapoint, with |
@chrisaljoudi The figures have to come from the same system to be able to compare them. Also, did you ensure that it's not the selfie which was loading? I made sure this was not the case with a breakpoint or a console message before starting to collect timing figures. |
@gorhill yep, I understand and you're obviously right about the figures having to come from the same system. As far as the selfie goes, yes — I clear I only wanted to share the figure because it was interesting, not for precise statistical significance. |
What's your system specs? |
2GHz Intel Core i7 |
@chrisaljoudi 207 ms is quite fast. If ever you also measure the timings for 0.8.8.3, I will include it in the tables with a note about different system. If you checkout |
I think I see why Safari is so fast compared to FF/Chromium: it's |
@gorhill 331 ms with 0.8.8.3. And yes, I think you're right about it being |
I am going to try one last thing to improve launch, somewhat trivial: reduce number of async calls at launch, waiting for data. |
Timings to complete
Safari, benchmarked on a different rig:
Timings for reloading all default filter lists (avg of 10 samples), in
|
Nice! It may only be fractions of a second, but it's the principle of the thing. |
When you start Firefox, by default the "about:home" page is loaded.
ABP and uBlock use the same lists.
This only happens when I start Firefox, if I open "about:home" afterwards it loads fast.
I didn't try other home page URLs, just about:home.
The text was updated successfully, but these errors were encountered: