News for hackers. Stuff that matters.
Re:The Rust Compilation Model Calamity by adamnemecek on Thursday January 30, 2020 @07:54PM (#22197836)
You have a monorepo with 2 million lines of code? How long is the compilation supposed to take?
Re:The Rust Compilation Model Calamity by disconnected on Thursday January 30, 2020 @08:23PM (#22198071)
I don't know how long it is "supposed" to take, but you can compile a Linux kernel (27.8M lines of code, though a good chunk of it probably isn't going to be compiled anyway because you don't need it, and another good chunk is architecture specific) in under 10 minutes on relatively modest (but modern) hardware.

On the other hand, something like Chromium (25M lines of code) will take about 8 hours, and bring your machine to its knees as it consumes ALL available resources (granted, last I did this I only had 8GB of RAM, and I was running my desktop at the time... including Chromium). I don't remember exactly how long Firefox takes to build, but I remember it was significantly less time (maybe 3 hours?).

So... it depends? On a lot of things?

(btw, LoC numbers were pulled from the first legitimate looking result I could find on a quick search... take with a grain of salt... also, compilation times are a rough approximation based on my observations... that it with a truckload of salt)

Re:The Rust Compilation Model Calamity by gpderetta on Thursday January 30, 2020 @08:38PM (#22198164)
Linking can consume huge amount of memory, especially for C++ code. For a large project 8GB might be very low. On our codebase we saw huge differences between 16GB machines and 24GB machines as the 16GB could not run some linking steps in parallel without swapping.

Does Chromium build use LTO (I'm pretty sure FF does)? That's also a huge resource sink a doesn't parallelize as well (a lot of the optimization will be delayed to linking)

Re:The Rust Compilation Model Calamity by Yoric on Friday January 31, 2020 @03:33AM (#22200060)
Last time I checked (admittedly a few years ago), a full build of Firefox on my beefy laptop was ~2h while working on something else and Chromium was 10h+ bringing the system to its knees.
Re:The Rust Compilation Model Calamity by azakai on Thursday January 30, 2020 @08:32PM (#22198125)
The 2 million figure includes vendored code. A quick count suggests the repo itself has less than 200K, https://codetabs.com/count-loc/count-loc-online.html