Firefox’s continued Quantum transformation—more multithreading, tracking protection


Firefox 58, out today, continues to deliver Project Quantum, Mozilla’s far-reaching modernization effort that’s boosting the browser’s performance, security, and maintainability. The initiative allows Firefox to take better advantage of modern multicore processors and makes the browser better suited to the demands of today’s Web applications.

The two highlights from today’s release are an optional Tracking Protection feature and new multithreading in the page rendering.

Firefox has had Tracking Protection in its Private Browsing mode for a couple of years. This actively blocks ads, analytics trackers, and social media sharing buttons, reducing the privacy exposure that these things can cause. Firefox 58 brings the option of using Tracking Protection even in the regular browser, blocking this content without having to use Private Browsing.

As well as improving privacy, Mozilla says that Tracking Protection can offer substantial improvements in page loading times. In a benchmark described last year that looks at the page load performance of the top 200 news sites, average load time was 7.7 seconds in Chrome, 7.3 seconds in Firefox Quantum, and just 3.2 seconds with Firefox Quantum and Tracking Protection.

The new multithreading work is a further separation of the different processes that go into the generation of the pixels that make up a rendered Web page. The purpose of this change is to make the browser better able to sustain high frame rates. To hit a constant 60 frames per second, the browser has only 16.6 milliseconds to generate the pixels for each frame. If the rendering process takes longer than 16 milliseconds, then the frame rate will necessarily drop.

Previously, Firefox would perform most of this work on its main thread: the visible elements of the page are identified, divided into different layers depending on if they’re scrolled and animated, and then rendered into a set of pixels. A separate thread, the compositor thread, would then assemble all these groups of pixels into a complete page.

In Firefox 58, that penultimate step—generating the pixels for each layer—is split into two portions. The first part is generating the sequence of drawing commands; the second is actually running those drawing commands in the graphics engine. The first part continues to run on the main thread, but now the second part, executing the drawing commands and producing the pixels, happens on its own thread. In general, generating the drawing commands is quick; it’s actually running them that takes the time. As such, this change cuts the amount of rendering work that’s done on the main thread, making it much more likely that it can finish within its 16 millisecond window and less likely that it has to delay rendering the next frame.

Overall, Mozilla says that this change enables the browser to sustain better framerates, especially on sites where the main thread is heavily burdened—ones with JavaScript and complex content.

Longer term, as part of the Quantum upgrades, this rendering stack is going to be replaced by a new component named WebRender. But getting WebRender production quality, on all of Firefox’s platforms, and with all the different device drivers and GPUs that are out there, is going to take time. For now, the multithreading provides a useful improvement in performance.

from Ars Technica http://ift.tt/2Dsv6J3
via IFTTT

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.