News for hackers. Stuff that matters.
Re:Firefox switching to clang-cl for Windows builds by kibwen on Tuesday July 10, 2018 @11:41PM (#17504315)
> Watch for more toolchain changes to come. The next steps after this will be to switch to lld-link and enable ThinLTO. That will open the door to a cross-language LTO that could inline calls between Rust and C++. In the longer term we can look into cross-compiling from Linux.

Very cool. The potential to inline Rust and C++ (and C, of course) code together at the LLVM level is one of those things that's been theoretically possible for a long time now but has yet to really mature in practice (at least, I'm not aware of anyone aside from Mozilla attempting it at scale). Really curious to see how this affects Firefox performance once they get it all wired up.

Re:Firefox switching to clang-cl for Windows builds by timClicks on Tuesday July 10, 2018 @11:47PM (#17504343)
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?

Re:Firefox switching to clang-cl for Windows builds by hsivonen on Wednesday July 11, 2018 @07:18AM (#17506027)
Multithreading 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.
Re:Firefox switching to clang-cl for Windows builds by agumonkey on Wednesday July 11, 2018 @12:00AM (#17504386)
I'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.
Re:Firefox switching to clang-cl for Windows builds by rhelmer on Wednesday July 11, 2018 @12:32AM (#17504487)
Huh! 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-c...

If it is still happening after you try those, use https://perf-html.io/ and share a profile.

Re:Firefox switching to clang-cl for Windows builds by tormeh on Wednesday July 11, 2018 @02:37AM (#17504881)
Known 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

Re:Firefox switching to clang-cl for Windows builds by agumonkey on Wednesday July 11, 2018 @06:09AM (#17505711)
only two webrender about:config entries are true

I'll see how it goes with the normal release

Re:Firefox switching to clang-cl for Windows builds by NiLSPACE on Wednesday July 11, 2018 @07:43AM (#17506140)
If you want to know for sure if Webrender is enabled you can go to about:config and check the Graphics section. If Compositing is 'Webrender' it's turned on.
Re:Firefox switching to clang-cl for Windows builds by agumonkey on Wednesday July 11, 2018 @08:07AM (#17506227)
all I can see is skia
Re:Firefox switching to clang-cl for Windows builds by dblohm7 on Wednesday July 11, 2018 @01:09AM (#17504581)
Are you on a Mac by any chance?
Re:Firefox switching to clang-cl for Windows builds by Reason077 on Wednesday July 11, 2018 @05:13AM (#17505516)
Funny 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?

Re:Firefox switching to clang-cl for Windows builds by lars_francke on Wednesday July 11, 2018 @06:07AM (#17505708)
I 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=...

https://bugzilla.mozilla.org/show_bug.cgi?id=1407536

https://news.ycombinator.com/item?id=17365510

Re:Firefox switching to clang-cl for Windows builds by agumonkey on Wednesday July 11, 2018 @06:09AM (#17505713)
thinkpad, old i5, archlinux
Re:Firefox switching to clang-cl for Windows builds by kibwen on Wednesday July 11, 2018 @11:39AM (#17507753)
In 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.
Re:Firefox switching to clang-cl for Windows builds by cmrx64 on Wednesday July 11, 2018 @01:54AM (#17504728)
Luqman got some neat results getting this to work iirc, way back in 2014.