What has changed in the browser "Firefox Quantum" which has evolved speed?



Beta versionAs released in September 2017 as "Firefox Quantum"Was released as the official version of" Firefox 57 "on 14th November. It is also faster than Chrome and evolved to a browser that is twice as fast as Firefox 52 announced a year ago, but Mozilla, which develops Firefox to see what has changed, blogs It is explained above.

Entering the Quantum Era-How Firefox got fast again and where it's going to get faster - Mozilla Hacks - the Web developer blog
https://hacks.mozilla.org/2017/11/entering-the-quantum-era-how-firefox-got-fast-again-and-where-its-going-to-get-faster/

In October 2016 Mozilla launched a parallel processing type rendering engine "ServoHigh-speed next-generation web engine based on "Project QuantumAnnounced. As a technique derived from Project Quantum, it is possible to launch more than 1600 tabs in just 15 seconds and dramatically improve memory usage "Quantum Flow"Has also appeared, Firefox Quantum has appeared as an" evolved browser "that summarizes these. Since its release as a beta version in September 2017, Firefox Quantum, whose presence has been drawing attention in developers and others, how quickly has it become faster?

◆ The big difference between Chrome and Firefox
To speed up browsers in the first place, you need to know how the hardware evolved over the past 10 years. Since Chrome first appeared, it is a faster and more responsive browser than Firefox. One of the reasons is that Chrome engineers have made a firm grasp of what changes are occurring in the hardware and have continued to improve on new hardware to make Chrome easier to use.


Since the advent of Chrome, a new style of CPU came into widespread use. "New style CPU" refers to those with multiple cores, each of which can perform independent tasks. However, if parallel processing is performed with a multi-core CPU, debugging is difficult and bugs are likely to occur. For example, if two cores that perform parallel processing have to write the same "1" number in memory, unless special attention is paid, writing "1" by one core overwrites the other write There is a possibility.

A simple way to avoid this sort of bug is to allow two cores you work without having to share memory, for example if you assign quite another task that does not need to cooperate. This is what is called coarse parallel processing. In a browser it is fairly easy to find such "coarse parallel processing", for example each tab opened in a browser can be regarded as an individual task.

Parallel processing is possible without interfering with each other's operation and reading speed with page loading. Also, if you have a long running script on the background tab, you will not interrupt reading the foreground tab. These features were born as a result of Chorme engineers' prediction of various things, and a long and steady road was waiting for Firefox to achieve similar behavior.


The following three functions were born by tracing such a long and steady road.

· Electrolysis
Electrolysis is one of the technologies that laid the foundation of Project Quantum. It is the same kind of multiprocess architecture introduced by Chrome, Firefox tested with a small group of users in 2016 and was released for all users in June 2017. It is said that it is said to have been developed over 8 years to speed up the behavior of browsers, and because there are cases in which it is not possible to benefit from specific add-ons, Please check the article.

What to do if browser acceleration technology "Electrolysis" introduced for all users in Firefox 54 does not turn on - GIGAZINE


· Quantum compositor
The biggest goal in the Quantum compositor was to stabilize the behavior of Firefox. Until now, once the graphics driver crashed, it was supposed to crash all Firefox, but by having another process at the Quantum compositor, Firefox's responsiveness is improving about.

Note that the Quantum compositor was installed in the official version of Firefox from Firefox 53 released in April 2017.

"Firefox 53" official release, with "Project Quantum" compositor improving security and performance - GIGAZINE


· Quantum DOM
Even though the content windows are split between the CPU cores and each main thread is separate, there are still many tasks that the main thread should execute. And some of the tasks that the main thread must perform may be more important than the ones running. For example, the task of reacting which key was pressed is a more important task than processing data in the trash can. The Quantum DOM provides a way to prioritize these tasks, which improves Firefox responsiveness.

◆ Maximize utilization of hardware through parallel processing beyond "crude parallel processing"
The crude parallel processing makes it possible to utilize the hardware more, but with this it can not make the best use of the capabilities of the hardware. For example, considering that each core of CPU handles a separate web page, if it is easy to load some web pages, the core that is finished work while the other core is working, and it becomes idle. Also, since it is necessary to read the page in another core, it takes time since only the single core will operate.


Reducing the number of cores that will be in this wait state will lead to better utilization of the CPU and the speed of displaying the web page should also be improved. However, coarse parallel processing can not allocate work from one core to another. That appeared there, "Firefox's fine-grain parallel processing". By breaking up large tasks into smaller tasks, we can load the same page with separate cores. For example, it is possible to have a separate core handle each picture shown on Pinterest for each picture.


This not only reduces latency but also improves pure page loading speed. There is also a feature that the page loading speed improves as the number of CPU cores increases.

Originally Mozilla seemed to have the idea of ​​"fine parallel processing", but it seems that the method to realize it was not clear, Mozilla seems to be "Rust" and the browser engine " Servo "and succeeded in developing a browser that is faster and less buggy. The following three technologies were utilized for that purpose.

· Quantum CSS (Stylo)
StyloAll CSS style processing is parallelized by the CPU core. By using a technique called worksteel, we efficiently divide work between cores so that all cores are busy. This is expected to greatly speed up, reducing the time taken for CSS style processing.


· Quantum Render (featuring WebRender)
One of the important elements in highly parallelized hardware is the GPU. The GPU has hundreds or thousands of cores, making it possible to process data faster by making these cores as busy as possible. It is used for that purposeWebRenderis. However, WebRender will appear in 2018.

· Others
Other parts of the rendering pipeline are also thought to benefit from "fine-grained parallelism", Mozilla says, "In the coming months we will further investigate where these technologies can be applied" is.

◆ Firefox will never be late
By making improvements besides major architectural changes, Mozilla says it will focus on keeping Firefox from becoming a slow browsing browser. Changes other than such a major architecture are as follows.

· Quantum Flow
Instead of focusing on the performance of a particular subsystem, Quantum Flow was born by investigating why it is less responsive than other browsers, focusing on special use cases, such as loading social media feeds It is technology. It is a technique that can solve the weak point of Firefox by activating more than 1600 tabs in only 15 seconds and dramatically improving memory usage.

With just 15 seconds you can boot more than 1600 tabs, dramatically improve memory usage, reveal the effect of "Quantum Flow" to eliminate the weaknesses of Firefox - GIGAZINE


In addition, Mozilla's Firefox development team is beginning to emerge from Firefox Quantum and will continue to improve performance in 2018.

in Software, Posted by logu_ii