summaryrefslogtreecommitdiff
path: root/published/open-source-insider-1703.txt
blob: 1712bc34772a7ebf4375210acac2ad27b1303de0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Mozilla has been slowly rolling out a major change for Firefox over the last year, the results of what the company calls its <a href="https://wiki.mozilla.org/Electrolysis">Electrolysis project</a>. Electrolysis gives Firefox something Chrome has had for years now -- multiple processes (in the best case scenario that's per-tab). The change is a boon for speed -- some place Firefox has been lagging lately -- and it improves stability and security.

The problem with per-tab processes in Firefox is that it's not exactly ground breaking. In fact this is a case of Firefox just now catching up to where Chrome was when it launched in 2008 -- welcome to the future Mozilla.

Still, while it's easy to make fun of Firefox for playing catch up, Electrolysis was no small feat. Chrome had the advantage of being designed for process-isolation from the ground up while Firefox had to work it in to its existing code base.

The good news for Firefox users is that Electrolysis isn't the only major change coming to Firefox this year. Despite these seemingly tumultuous times at Mozilla, Firefox engineers have outlined a plan to re-write the engine behind Firefox.

The company calls this effort <a href="https://wiki.mozilla.org/Quantum">Project Quantum</a> and, despite the name, it looks to be a major change for Firefox. Indeed perhaps the biggest change since Firefox first launched.

The major goal is to create a new rendering engine that's able to exploit the full power of today's hardware, which is a kind of marketing-speak for "we're going to isolate every process and offload more rendering tasks to the GPU".

A large portion of Quantum will be pulled from the existing <a href="https://servo.org/">Servo project</a> which is a low-level re-write of Firefox's Gecko rendering engine. Servo remains an independent project and covers a lot more ground (for example it provides an API for using Servo inside other projects and it's been ported to Android by Samsung). Quantum takes what's good about Servo -- independent processes for all the things, the Rust programming language -- and brings it to Firefox.

But that's not all Quantum plans to do. Mozilla's David Bryant, Head of Platform Engineering, <a href="https://medium.com/mozilla-tech/a-quantum-leap-for-the-web-a3b7174b3c12#.l322x8dk5">writes</a> that Quantum will also see Mozilla going back to the drawing board to "rethink many fundamental aspects of how a browser engine works". That means potentially "re-engineering foundational building blocks, like how we apply CSS styles, how we execute DOM operations, and how we render graphics to your screen".

Right now, for example, any CSS file in the head of an HTML document must be downloaded and rendered before a page can be displayed. That slows down the rendering of pages, especially on sites that use poorly-coded blogging tools that pile in stylesheets like they're delicious candy -- I'm looking at you WordPress plugin developers. They're not candy, they're a rendering nightmare.

But since it seems there's just no way to stop the web-slowing world of crappy blogging tools, perhaps the browser can figure out a way around this by re-thinking the rendering process. Perhaps not stopping for every stylesheet, but instead spinning off a new process for each stylesheet would help mitigate the problem (or we could all rediscover lynx and w3m, problem solved).

In fact, this is already part of Servo and by extension Quantum. It's one of the <a href="https://wiki.mozilla.org/Quantum">four core components</a> of Quantum which are Quantum CSS, Quantum Render, Quantum Compositor, and Quantum Flow. Quantum Render is where Servo's process isolation and GPU offloading come in and Quantum Compositor builds on Gecko's existing compositor, but moves it to its own process (notice a running theme here?). The last bit is the least developed right now, but it will encompass other things like UI speed improvements.

If all this sounds like an overly large project that may never actually ship code, well, I share your concern. Bryant's article is from late 2016 and claims that Mozilla is "going to ship major improvements next year", though there is no specific date. In a recent post about Firefox's new Web Assembly feature Bryant <a href="https://medium.com/mozilla-tech/why-webassembly-is-a-game-changer-for-the-web-and-a-source-of-pride-for-mozilla-and-firefox-dda80e4c43cb#.d6nrwt5du">says</a> that "Project Quantum is well underway". 

In light of recent changes and, frankly, what feels like disarray at Mozilla, it's tough to get too excited about anything. Still Quantum looks promising and may be the thing Mozilla needs to get it back on track and provide a bit a focus in the midst of its current disarray.