4 ms·
Rust's performance benefits won't be immediate, as single-threaded C++ is already very fast and safe parallelism benefits of Rust would be difficult (impossible
by timClicks 8y ago
Rust's performance benefits won't be immediate, as single-threaded C++ is already very fast and safe parallelism benefits of Rust would be difficult (impossible?) to leverage across language boundaries.
I'm more interested in seeing whether the maintainability of Firefox will increase over time as the proportion of Rust code increases. That is, will Mozilla be able to accelerate Firefox's development because the source code is in a safer language?
- agumonkey 8y agoI'm trying firefox nightly these days and I notice my cpu has burning peaks (60 -> 80 C) I wonder if rust parallelism isn't kill my poor laptop heatsink/fan.
- rhelmer 8y agoHuh! I wouldn't expect that at all... here are some easy things to try: https://support.mozilla.org/en-US/kb/firefox-uses-too-many-cpu-resources-how-fix https://support.mozilla.org/en-US/kb/firefox-uses-too-many-c... If it is still happening after you try those, use https://perf-html.io/ https://perf-html.io/ and share a profile.
- dblohm7 8y agoAre you on a Mac by any chance?
- Reason077 8y agoFunny you mention this. While Firefox’s interactive performance on Mac feels absolutely fine, it’s energy consumption is dramatically worse compared to Safari. Using Firefox over Safari can cost hours of battery life, so it’s very hard to recommend it. Is this just a Mac issue?
- lars_francke 8y agoI know of one issue with Firefox when you are using a scaled resolution. It absolutely destroys battery and performance for me. I _think_ it has gotten better with the latest versions but the tickets are still open. https://bugzilla.mozilla.org/show_bug.cgi?format=default&id=1404042 https://bugzilla.mozilla.org/show_bug.cgi?format=default&id=... https://bugzilla.mozilla.org/show_bug.cgi?id=1407536 https://bugzilla.mozilla.org/show_bug.cgi?id=1407536 https://news.ycombinator.com/item?id=17365510 https://news.ycombinator.com/item?id=17365510
- agumonkey 8y agothinkpad, old i5, archlinux
- tormeh 8y agoKnown bug, I think, assuming you've enabled webrender. They're still working on correctness. They haven't gotten to optimization yet. Also nightly contains all sorts of debug stuff
- agumonkey 8y agoonly two webrender about:config entries are true I'll see how it goes with the normal release
- hsivonen 8y agoMultithreading isn't Rust's only performance benefit. Another is being able to write single-threaded code in a way that'd be too risky to do without the borrow checker making sure it's OK. (I.e. in C++ one would write something a bit slower but easier to reason about.) A cool upcoming single-threaded performance boost in Rust is std::simd, which provides portable (non-ISA-specific LLVM abstraction) SIMD that you can augment with ISA-specific operations where needed. Firefox doesn't use it yet, but Firefox already uses the older (to be obsoleted by std::simd) simd crate that provides the same thing a little differently.
- kibwen 8y agoIn my comment I actually wasn't talking about parallel Rust providing a performance benefit over single-threaded C++, I was referring to how, by writing their codebase in two different languages, they're missing out on theoretical optimization potential (via inlining) and thereby leaving performance on the table wherever Rust code interfaces with C++ code. By enabling cross-language inlining via LLVM, it should ideally erase any theoretical optimization penalty incurred by writing Firefox in two languages.