4 ms·
Not really. Parts of Firefox like Tracemonkey (or whatever they call the js engine now) aren't going to be rewritten because it would take a decade to do. I exp
by mastax 9y ago
Not really. Parts of Firefox like Tracemonkey (or whatever they call the js engine now) aren't going to be rewritten because it would take a decade to do. I expect that Firefox will always be built more like a C++ project with Rust components than the other way.
That said "project quantum" is about improving the browser which applies to all of the code not just the Rust parts.
- AdmiralAsshat 9y agoI see. The page didn't really go into specifics about how they made Firefox Quantum faster, so I had assumed that it was faster because they were rewriting parts in Rust.
- steveklabnik 9y agoThose who work on Servo/Firefox have stated before that it's not "because they were rewriting parts in Rust", but because they've been re-architected for today's hardware. Rust is still significant, as its safety features allowed them to pull off things like aggressive parallelism without introducing tricky bugs. But people don't generally believe that simply re-writing something in Rust instantly makes it faster. I am synthesizing previous comments here, so take this with a grain of salt. Maybe ManishEarth or pcwalton will chime in.
- kibwen 9y agoAside from the performance gains that you'd naturally expect from an expert rewrite, lots of the performance gains are due to aggressive concurrency and parallelization, which is a task that Rust is designed to excel at.
- Manishearth 9y agoThe CSS handling system is now in Rust, and is massively parallel (Rust lets us do this easily), which is why that is faster. This leads to significant performance benefits because CSS cascading/"styling" happens pretty often, including on every DOM manipulation, and can slow down interactions. But also there has been a major push to fix performance issues in other parts of the browser which itself has lead to significant improvements across the board.
- 482794793792894 9y agoIn part, it is because of a Rust component. A new CSS engine, Stylo, is shipping with 57 and that brought a noticeable performance improvement. In the foreseeable future there will also be WebRender, which should give an even bigger improvement, but that wasn't ready for 57. Another big part is that they recently switched Firefox over to a multiprocess architecture (Firefox 48) and these performance improvements are now mostly optimizations that are now possible due to this architecture. Basically offloading all kinds of slower operations into a background thread. The optimizations are all over the place, mostly of smaller nature, but taken together they make a big difference. And a third point is the new UI. It is partially really just more efficient, partially uses animations and such to trick your brain into thinking that things are faster, and then it also now has "tab warm-up", which basically means that when you hover with your mouse over a tab, it already starts loading in that tab, so that it's instantly there when you click.
- Vinnl 9y ago> it also now has "tab warm-up", which basically means that when you hover with your mouse over a tab, it already starts loading in that tab, so that it's instantly there when you click. They actually removed that again for now due to instability, IIRC it's slated to arrive in Firefox 58.
- staticassertion 9y ago> ren't going to be rewritten because it would take a decade to do. Semi-related question - does anyone know what that would look like? Like if someone were to rewrite v8/Tracemonkey from scratch, what's the cutting edge research on this?