Announcing Project Async & Responsive
April 10, 2013 § 24 Comments
tl;dr
Project Snappy has been retired and replaced by several smaller projects, including Async & Responsive. The objective of this project is to improve the responsiveness of Firefox and the Mozilla Platform by converting key components to make them asynchronous and, wherever possible, to move them off the main thread.
The setting
Firefox and other Mozilla applications are great products, in particular in terms of performance. They are based on an extremely fast rendering engine, Gecko, and its companion JavaScript engine, which in addition to being the richest JS engine around, is also, these days, quite possibly the fastest. What is not so great, unfortunately, is that despite these great core performances, Mozilla applications have often been perceived as slow and sluggish.
Project Snappy was formed about 18 months ago to focus the effort by Mozilla developers to fight this perceived sluggishness. During this period, we have made tremendous progress, thanks to the commitment of everyone involved. Indeed, most of the long-term objectives of Snappy have been reached already. We have therefore decided to retire project Snappy, in favor of both a larger project Performance, and several sub-projects focusing on distinct aspects of Performance.
Let me introduce Asynchronous & Responsive [1], one of the sub-projects of Performance.
Project outline
Despite considerable progress, much of Firefox still behaves as a single-threaded application. Most services and components are initialized sequentially in the main thread, run in the main thread, are shutdown sequentially in the main thread. Also, most add-ons execute essentially in the main thread. As a consequence, any long-lived task can disrupt the user experience.
There are historical reasons for this, but in most cases, there is not deep blocker that would prevent us from rewriting services. Project Asynchronous & Responsive is now starting to support and focus the ongoing effort to get rid of main thread services and components, both in platform code and in add-on code, for the betterment of all Mozillakind.
This entails:
- identifying blockers that prevent platform and add-on developers from deploying their code on non-main threads (generally, worker threads);
- helping platform and add-on developers transition their code off-main thread;
- actually transitioning some of our services and components off the main thread.
Please note that we have no intention of working on the JavaScript VM, on DOM or Graphics. These teams already have dedicated developers working on moving things off the main thread.
Following our progress
As I am the tech lead of this project, you will find more information on this blog, under category Performance.
I will try and post updates every second week.
[1] If you have an idea of a nicer name that does not sound too much like “Snappy”, we are interested 🙂 Marxist jokes about Workers might or might not be accepted.
Project Dejankify?
No, that’s a bit too generic. Vladan is also leading Project Gecko Responsiveness, which is also about jank.
Silk – It’s made out of very fine “threads” 😉
Nice. Might be confused with http://supertech.csail.mit.edu/cilk/, though.
I for one am glad Mozilla didn’t go the process per page model. The main benefit being lower memory usage.
But why not put the main UI in one process, and the page rendering in another?
Is that really much more work that rewriting a bunch of subsystems?
Actually, that’s another parallel project: https://bugzilla.mozilla.org/show_bug.cgi?id=718121
Project MT caffeine (“caffeine” as the goal being total reponsiveness for the Main Thread)
Caffeine makes me janky, not snappy 🙂
How about project Quick Brown Fox, from the pangram?
Too generic, I’m afraid.
I think both “Project Async & Responsive” and “Project Asynchronous & Responsive” don’t flow real well in English (and the latter is too long, if not the former as well).
The main thrust of the ‘how’ for the project is asynchronicity. I say just call it Project Async.
It’s quick to say and refer to, communicates what the project is mainly doing and people were going to find a way to shorten it anyway – this saves the trouble.
I was just about to suggest “Project Async”. It’s what you’d inevitably shorten it to, anyway.
What about shortening Snappy and calling it “Snap!”?
Needle – this project deals with threads.
Project Workers’ Writes?
Yeah, okay, I’ll see myself out…
I’m voting for Ex-Lax.
How about “Project Async” and your team logo is a sink (the wash basin kind. it would be funny
I’ll just put this here…
http://www-archive.mozilla.org/docs/web-developer/samples/kitchensink.xml
I like it!
[…] of the main objectives of Project Async is to encourage developers to use Chrome Workers to ensure that whatever they do doesn’t […]
Is this project is related to Electrolysis? (https://wiki.mozilla.org/Electrolysis). And do we know when it will be added to Firefox?
Async & Responsive and Electrolysis are two distinct projects, although we are working together on some topics.
Electrolysis is about having one or more “content processes” to execute everything that users see in tabs (mostly, but not only, webpages themselves) and one “chrome process” executing everything else (including the user interface, but also bookmarks, preferences, history, etc.). Electrolysis will ensure that heavy web content does not freeze the whole browser and that a crash in a tab does not take the entire browser with it. Some small bits of Electrolysis have landed recently on Nightly. I do not know of a specific calendar but my intuition tells me that we shouldn’t expect anything user-noticeable before 2014. Firefox OS itself uses Electrolysis everywhere.
Async & Responsive is about giving developers (both Firefox/Firefox OS developers and add-on developers) the necessary tools to let them write JS code that does not noticeably block the process in which they are executed. Async & Responsive has landed a number of refactorings (e.g. to Session Restore, to our database library, to file access, to downloads, to the way we handle bookmarks and history, etc.) and will continue to do so in parallel, mostly invisibly for users.
Does that answer your question?
Yes thank you for your answer, I understand the differences now. About my second question (when will i be added to FF), in fact, the real question was: when will we be able to see a Firefox that “feels” as fast as Firefox? Even if benchmarks never demonstrate it explicitely, I find that FF “feels” slower than Chrome and I think that is it its biggest weakness.
There is no single landing date. We are landing bits of Async with every version of Firefox, and Firefox now has a few user-invisible bits running with e10s already.