Some power users start the day with the default config in 40-50 open tabs. During the day, another couple of tens or even a hundred may be added to this group. Although this is an extremely non-standard behavioral pattern, some of them work just like that. It is curious to see how browsers behave in such an emergency situation. One of the developers of Firefox, graduate student Gregor Wagner, decided to conduct
tests on the latest builds of Chrome and Firefox.
Wagner is developing various memory allocation strategies for Firefox. In the latest versions of Firefox, developers have significantly optimized the browser in this regard.
150 sites taken from the
list of the most popular sites . Habrahabr did not enter there, because it occupies only 462nd place in the world in popularity.
Script MemBench opened one new tab every 1.5 seconds. Upon reaching the limit of 150 tabs, he waited 90 seconds until all pages were loaded, and displayed a text message about the end of the test. Test machine: Dual-core MacBook Pro with 8 GB RAM.
')
For the latest build of Firefox Nightly (Firefox 8), the following results are obtained:
real 6 min 14,406 s
user 3 min 55,302 s
sys 0 min 49,366 s
This is what the Chrome canary build showed:
real 28 min 55,573 seconds
user 21 min 58,383 s
sys 14 min 40,860 s
As you can see, the difference is huge. It turned out that Chrome starts with great difficulty to open new tabs after about the 70th. On 150 sites, Gregor could not even properly scroll the page. Firefox, in turn, behaved quite normally, as if there were no other open tabs.
What is the reason? The fact is that Firefox uses the
“one process - many branches” model (
PDF ), so all 150 tabs fit into 27 threads and 2.02 GB of RAM.
Chrome uses the
opposite approach , in which tasks are broken down into several processes. As a result, the Google Chrome Renderer process constantly uses 100% CPU and occupied 1.5 GB on 150 tabs. The main process of Google Chrome uses 212 threads and 1.3 GB. There is an additional process Helper with 200 MB.
Here is the result of running the V8 benchmark in Firefox on the full load of all 150 pages.
Firefox Score: 3954
Richards: 8014
DeltaBlue: 4149
Crypto: 8781
RayTrace: 3007
EarleyBoyer: 3112
RegExp: 959
Splay: 5764
Compare with the result with one open tab:
Firefox Score: 5125
Richards: 7925
DeltaBlue: 5005
Crypto: 8791
RayTrace: 3976
EarleyBoyer: 5003
RegExp: 2188
Splay: 6120
An attempt to run a V8 test on Chrome failed: the browser stopped rendering, the Google Chrome process did not fall below 100% of the CPU.
Conclusion from Gregor Wagner: if you need a lot of tabs, use Firefox! (Opera users may not agree with this conclusion, they say, this browser works surprisingly well with a large number of tabs)