Mozilla plans to introduce Off-Main-Thread painting in the next stable version of the Firefox browser to improve the browser's performance significantly.
Basically, what Mozilla did was move rasterization to its own thread. When Firefox renders a web page, certain activities happen in the background.
Three of the four, making a display list, assigning layers and rasterization, happen in the main thread, while compositing happens in a separate thread.
Mozilla's solution to improve performance records commands for rasterization in the main thread, but sends these recorded commands to the new paint thread where the rasterization happens. From there, data is sent to the compositor thread.
The cost of rasterization depends on a number of factors including the display resolution. Rasterization is more expensive the higher the monitor resolution is, about ten times on a 4K screen when compared to a 1024x768 screen according to Mozilla.
The effect that Off-Main-Thread painting has on Firefox's performance is significant. Mozilla measures performance by analyzing how much time rasterization requires.
In Firefox 57, rasterization that used less than 10% of the paint cycle occurred 51% of the time. Off-Main-Thread painting improved that figure to 80% in Firefox 58.
Rasterization costs used 50% or more of a paint cycle 21% of the time in Firefox 57. With Off-Main-Thread painting enabled in Firefox 58, that figure dropped to just 4%.
The FPS improved in the benchmark by 30% with Direct2D and by 25% with Skia in Firefox 58 when compared to Firefox 57.
Mozilla plans to improve Off-Main-Thread painting further. The organization's engineers have set their sight on parallel painting for instance, and on resolving some of the outstanding issues, for instance that Firefox does not support "rasterizing 'mask' layers on the paint thread" currently.
You find additional -- technical -- information on Off-Main-Thread painting on the Mozilla GFX blog.
Will users notice the improvement? It depends on their system, and what they do on the Internet.
Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.
We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats or subscription fees.
If you like our content, and would like to help, please consider making a contribution:
Ghacks is a technology news blog that was founded in 2005 by Martin Brinkmann. It has since then become one of the most popular tech news sites on the Internet with five authors and regular contributions from freelance writers.