Firefox 70 for macOS has succeeded in reducing power consumption by more than 60%

Mozilla announced that

Firefox 70 has changed the way windows are displayed on macOS. This reduces the burden on the PC due to screen processing and can reduce power consumption during browsing by more than two-thirds.

Dramatically reduced power usage in Firefox 70 on macOS with Core Animation – Mozilla Gfx Team Blog

According to Mozilla, until Firefox 69 , windows are displayed mainly in the following three steps.

Step 1: Draw pixels on the Gecko graphics layer.

Step 2: The rendered graphics layer is combined into a single image by the compositor and the window rendered.

Step 3: The OS window manager assembles the windows on the screen and generates the content.

In Firefox 70, improvements were made in steps 2 and 3. The macOS Firefox compositor uses hardware acceleration via a graphics API called

OpenGL . However, macOS does not provide a way to show what has changed in the OpenGL rendering context. Therefore, while partial redrawing is possible in Windows, full-screen redrawing is always performed in macOS, which consumes more power.

Therefore, Mozilla decided to use the middleware Core Animation, which is a UIOS rendering process installed in macOS.

Core Animation lets you share GPU buffers with window managers in a way that minimizes copying. Firefox 70 creates an IOSurface , treats it as an offscreen frame buffer, renders directly using OpenGL, and assigns the created IOSurface to the CALayer . And when the window manager composes the CALayer on the screen, it is read directly from the GPU buffer without any additional copies.

With Core Animation, you can render to multiple locations in a window at the same time and update them in sync. Also, the rendered content can be easily moved within the window. Mozilla says scrolling can be done efficiently.

By using Core Animation, rendering of Firefox 70 on macOS has become as follows.

Step 1: Draw pixels on the Gecko graphics layer.
Step 2: The Firefox compositor combines the relevant Gecko graphics layer for each CALayer square tile in the window and redraws the modified part of the CALayer.
Step 3: The OS window manager assembles all the windows and CALayer updated on the screen and generates the content.

The graph below shows bar graphs of power consumption when performing various tasks on Firefox 69 (blue) and Firefox 70 (red) on the 2013 model MacBook Pro (macOS 10.14.6). According to Mozilla, Firefox can reduce power consumption by more than a third in many cases.

The graph of power consumption, CPU clock frequency, temperature, usage rate when using Firefox 69 is like this.

On the other hand, the graph when using Firefox 70 is as follows. Certainly the power consumption and temperature are lower than when using Firefox 69.

Mozilla said it is also looking to further improve browser scrolling and full-screen rendering efficiency by adapting the WebRender function that speeds up Firefox browsing to the macOS environment.

in Software, Posted by log1i_yk