19
February
2024
Optimizing Mozilla FireFox performance
11:20

Optimizing Mozilla FireFox performance

19 February 2024 11:20

For old PCs or, conversely, new ones, you can significantly improve the performance of the Mozilla FireFox browser by changing the settings in about:config.

Mozilla conducted research into the influence of system parameters on the speed of the FireFox browser in its Dory project. It sets the influence of the following settings, changing the values of which reduces the number of dropped frames when browsing the web:

Parameter name Default value New value
javascript.options.baselinejit.threshold 100 50
javascript.options.ion.threshold 1500 5000
network.buffer.cache.size 32768 65535

I have found that the font rendering parameter browser.display.auto_quality_min_font_size has the greatest increase in performance when scrolling the screen.
For low-resolution screens, its value must be increased to 1000 and higher - the font size to which fonts are displayed using a simplified, accelerated algorithm. For high resolution screens 2K, 4K or 8K, the parameter should be reduced to 0 - always display fonts in highest quality.

Parameter name Default value New value
browser.display.auto_quality_min_font_size 20 0 или 1000

0 - for modern PCs and 4k monitors,
1000 - for weak computers.

In order for the number of parallel JavaScript threads to correspond to the number of processor cores, you need to increase the following parameter (instead of 4, I set it to 8 even on an old PC with a dual-core processor - because with multithreading, the speed and smoothness of work still improves).

Parameter name Default value New value
javascript.options.concurrent_multiprocess_gcs.cpu_divisor 4 8

As a result of these changes, the processor load of the site https://www.rbc.ru/, which uses “scroll lines,” has decreased. CPU load can be viewed in top or htop.

Regarding JavaScript, without which it is impossible to imagine modern websites, the website hacks.mozilla.org says the following:

Firefox has an interpreter written in C++ and several levels of JIT compiler:

  • Basic JIT. Where each small amount of JavaScript code is converted to machine code
  • IonMonkey (or simply Ion), more advanced optimizing JS compiler.

Basic JIT is faster, but cannot cope with the large amounts of code that heavy websites offer.
Controlling the choice of one or another interpreter is the above parameter javascript.options.baselinejit.threshold (default value 100, new value 50).

Check on the website https://browserbench.org/Speedometer2.1/ showed the following results:

JIT threshold 0 50 100
Speed, tests per minute 55.8 59.0 57.4

You can see the benefit of setting the JIT threshold to 50.

Continuation: part 2.

Sources:

Clipart:
FreeVector.com



Related publications