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 project Dory. As a result, the influence of the following settings has been established, changing the values of which reduces the number of dropped frames when browsing the web:

Parameter Default New meaning
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 option has the biggest performance boost when scrolling the screen browser.display.auto_quality_min_font_size.

For low-resolution screens, its value should 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 high quality.

Parameter Default New meaning
browser.display.auto_quality_min_font_size 20 0 or 1000

0- for modern PCs and 4k,
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 a weak PC - because with multithreading, the speed and smoothness of work still improves).

Parameter Default New meaning
javascript.options.concurrent_multiprocess_gcs.cpu_divisor 4 8

As a result of these changes, the CPU load on the site has decreased https://www.rbc.ru/, which uses tickers. The CPU load can be viewed in top или 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:

  • Basic JIT. Each bytecode instruction is compiled directly into a small piece of machine code. It uses integrated caches (ICs) to both optimize performance and collect type information for Ion.
  • IonMonkey (or simply Ion), which optimizes JIT. It uses advanced compiler optimizations to produce fast code for hot functions (at the expense of slower compilation times).
    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 site 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.

Continued:part 2.

Sources:
Project Dory
Browser.display.auto_quality_min_font_size
*The Baseline Interpreter: a faster JS interpreter in Firefox 70

FireFox logo image source (ClipArt):
FreeVector.com



Related publications