Mozilla Servo



  1. What Are Mozilla Service Workers
  2. Mozilla Servo Vs Gecko

But Mozilla has never had the capital to push Servo’s development to the level that Google does with Chromium, and for a while now, even less so. Besides, despite the brief interests that Servo has aroused along its path, things are as they are and, of course, it doesn’t seem that passing the death -because a project of this magnitude. Servo is written in Rust, and shares code with Mozilla Firefox and the wider Rust ecosystem. Since its creation in 2012, Servo has contributed to W3C/WHATWG web standards by reporting specification issues and submitting new cross-browser automated tests, and core team members have co-edited new standards that have been adopted by other browsers. Servo is a prototype web browser engine written in the Rust language. It is currently developed on 64-bit macOS, 64-bit Linux, 64-bit Windows, and Android. Servo welcomes contribution from everyone. See CONTRIBUTING.md and HACKINGQUICKSTART.md for help getting started.

Did you know...?

LWN.net is a subscriber-supported publication; we rely on subscribers to keep the entire operation going. Please help out by buying a subscription and keeping LWN on the net.

The Firefox codebase dates back to 2002, when the browser was unbundled fromthe Mozilla Application Suite—although much of its architecturepredates even that split. Major changes have been rare over theyears, but recently several long-running Mozilla efforts have startedto see the light of day. The most recent of these is the Servoweb-rendering engine, for which the first standalone test builds werereleasedon June 30. Although the Servo builds are not full-blownbrowsers, they enable users to download and test the engine on liveweb sites for the first time. Servo is designed with speed andconcurrency in mind, and if all goes according to plan, the code maywork its way into Firefox in due course.

Servo, for those unfamiliar, is a web renderingengine—roughly analogous to Gecko in the current Firefoxarchitecture and WebKit or Blink in other browsers. It does notexecute JavaScript, but is responsible for interpreting HTML and CSSand performs the vast majority of page layout operations.

The interesting facets of Servo are that it is written to beextensively parallel in execution and that it is designed to beintrinsically secure against the most common security bugs that plaguebrowsers (and other application software). This security comes by virtueof being developed in the Rustlanguage, which has a variety of built-in memory-safety features.Rust also offers concurrency features that Servo can leverage to doparallel page rendering. As a practical matter, this should enablefaster rendering on today's multi-core hardware.

In 2015, we covered a talk atLinuxCon Japan by Lars Bergstrom and Mike Blumenkrantz that exploredServo's design. In that talk, the two speakers cautioned that Servois a research project and that it is not scheduled to be a drop-inreplacement for Gecko—at least, not on thedesktop—although they did indicate that certain partsof Servo may be migrated into Gecko.

The June 30 announcement marked the release of a series ofpre-built binaries that wrap the Servo engine with a minimalistbrowser GUI (based on Browser.html).The binaries are automatically built nightly, and are initiallyprovided for Mac OS X and x86_64 Linux only, although there aretracking bugs available for users to see when Windows and Android buildswill be available. It is also possible to build the nightlies fromsource; the Servo wiki includes a page about building for Linux on ARM.

Because the nightly builds are not full browsers, the interfaceleaves out most of the traditional browser chrome. Instead, thebrowser's start page presentsa set of eight tiles linking to some well-known web sites, four tileslinking to graphics-intensive demos, a URL entry bar that doubles as aDuckDuckGo search bar (plus forward and back buttons and a 'new tab' button). The same start page isaccessible through other browsers. In some non-scientific testing, itis easy to see that Servo loads certain pages faster than recentFirefox releases—Wikipedia and Hacker News stand out among theeight tiles, for instance. On my four-core desktop machine, the difference wasabout twofold, although to provide a truly fair test, one should compareagainst Gecko (or another engine) with ad-blocking andtracker-blocking disabled, and with a clear cache.

Or, to be more precise, one could say that Servo begins toshow the page sooner than Firefox. In many cases, Firefox takes along pause to fully lay out the page content before anything isdisplayed, while Servo begins placing page elements on screen almostimmediately, even if it still takes several additional seconds beforethe page-load progress bar at the top of the window indicatessuccess. That is in keeping with Bergstrom and Blumenkrantz'scomments about slow-to-load sites in Firefox: many pages are built with framesand <div> elements that are fetched separately, soloading them concurrently is where much of the time is saved.

The speed difference on the graphics demos was more drastic;the Firefox 47 build I used could barely even animatethe Moireand TransparentRectangle demos, while they ran smoothly on Servo.

The engine already provides good coverage of older HTML and CSS elements,with a few exceptions (frames and form controls, for example). Newer webspecifications, including multimedia and web-application–driven standardslike ServiceWorkers tend to be less fully developed. Here again, the Servowiki provides a page totrack the project's progress.

Based on these early test builds, Servo looks promising. Therewere several occasions where it locked up completely, which would notbe too surprising on any nightly build. But it is encouraging to seethat it is already faster at rendering certain content than Gecko—and wellbefore the project turns its attention to optimization.

Lest anyone get too excited about Servo's potential to replaceGecko, for the time being there is no such plan on the books. But theplan to patch some Servo components into Gecko or other Firefoxmodules appears to still be in the roadmap. Tracking bugs exist for afew components, such as Servo's URLparser and CSS stylehandling. The plan also notes that Servo is being looked at as areplacement for Gecko on Android, however, and as a reusableweb-rendering engine—a use-case Mozilla has not addressed forquite some time.

Although that work still appears to be many releases removed fromend users, it is worth noting that Firefox has moved forward onseveral other long-term projects in the past few months. In June, thefirst Firefox builds using Electrolysis,Mozilla's project to refactor Firefox for multi-process operation, were madeavailable in the Beta channel. Recent Firefox releases have alsosuccessfully moved from the oldextensions APIs to WebExtensions. Bothof those changes are substantial, and both (like Servo) shouldprovide improved security and performance.

Over the years, Mozilla has taken quite a bit of criticism for theaging architecture of Firefox—although, one must point out thatMozilla also takes quite a bit of criticism whenever it changesFirefox. If anything, the new Servo demos provide an opportunity forthe public to see that some of Mozilla's research projects can havetangible benefits. One way or another, Firefox will reap benefitsfrom Servo, as may other free-software projects looking for a modernweb-rendering engine.

(Log in to post comments)

Because of Webkit’s increasing monopoly in the browser rendering engine space, Gecko has been falling behind lately, and perhaps most importantly, it’s failing to excite open source developers, to participate in developing it. That’s where Servo comes in – Mozilla’s new rendering engine made from scratch and written in their new language called Rust, which is meant to be a “close to the metal” (where the Rust name comes from) alternative to C++.

Rust

Servo is a halo project for their brand new Rust language, which is still only at version 0.6, and could take at least another year before it reaches a stable 1.0 version, which could mean we’re at least 2 years out before Servo is completed. They need to finish the language first, because they even get too deep into writing the Servo rendering engine.

Mozilla ServoGithubRust web browser

However, Rust has been in development for several years already, and it’s quickly approaching stability, but I assume Mozilla is taking a more conservative approach to finishing it, because they want it to be a well designed language:

“It is intended to fill many of the same niches that C++ has over the past decades, with efficient high-level, multi-paradigm abstractions, and offers precise control over hardware resources. But beyond that, it is *safe by default*, preventing entire classes of memory management errors that lead to crashes and security vulnerabilities. Rust also features lightweight concurrency primitives that make it easy for programmers to leverage the power of the many CPU cores available on current and future computing platforms.”

Servo

While Servo is a halo project for Rust, meant to get people excited about Rust, the main reason Mozilla, with Samsung’s help, is developing it, is because they want to take advantage of the future computing technology, under the umbrella of “heterogeneous computing”, which means harnessing the power of not just CPU’s, but GPU’s, accelerators and other types of future processors, too. That also includes taking full advantage of multi-core CPU’s, too. Servo is going to be written from the ground up to take advantage of multi-core heterogeneous computing.

Samsung is helping them, because they are one of the main partners in the HSA Foundation, along with ARM, AMD, Qualcomm, Imagination, and many others. It’s also one of the main reasons why Mozilla is building this new rendering engine specifically for the ARM chip architecture and Android. Of course, they would also use it for their own Firefox OS in the future, to increase its performance.

What Are Mozilla Service Workers

Servo is a much needed project for Mozilla, if they want to excite open source developers, and take the lead on performance once again against Chrome and others.

Mozilla Servo Vs Gecko

[Via Mozilla]