5 ms·
I once read somewhere that the time to compile Linux from source on high-end desktop hardware has remained remarkably stable over the years.
by CreRecombinase 7y ago
I once read somewhere that the time to compile Linux from source on high-end desktop hardware has remained remarkably stable over the years.
- lisper 7y agoYes, that's true. It has been O(1 hour) for pretty much the entire history of Linux. And if you think about it, this makes sense. If it were significantly less than that, the development cycle would speed up so it would be easier to add capabilities, which would slow down the build. If it were significantly longer, the addition of new features would slow down until the hardware started to catch up. So the compile time acts as a sort of natural control mechanism to throttle the addition of new features.
- cyphar 7y agoI'm not sure that is the primary reason -- many other projects have had their compile times explode over many years, even though the same logic should apply. Not to mention if you build the kernel regularly, you benefit from incremental compilation. If you change a few non-header files the rebuild time can be as little as 2-3 minutes. Oh, and "make localdefconfig" will reduce your from-scratch compile times to the 5-15 minute mark. I highly doubt most kernel devs are building a distro configuration when testing (especially since they'd be testing either in a VM or on their local machine).
- lisper 7y ago> many other projects have had their compile times explode over many years Like, for example?
- brantonb 7y agoWhen I worked at Microsoft, Windows took far, far longer than an hour to build from scratch. I remember walking a few buildings over to the burn lab to pick up DVDs of the latest build. I don’t have any hard data, but running a full build on your dev box was very rarely done.
- pretty_bubbles 7y agoWas it just the windows kernel? Or did it include all of the utilities in Windows?
- lisper 7y agoThe dynamics of commercial projects can be very different from open-source. You're much more likely to tolerate sitting through long builds if you're being paid to do so.
- fest 7y agoUntil management notices, does the X hours saved multiplication by number of developers, and the resources for improvement will be found soon.
- cameronbrown 7y agoDefinitely not. People are far more expensive than machines.
- lonelappde 7y agoIt's a lower bound for a highly active project.
- giancarlostoro 7y agoI'm convinced that compiler speed is all a matter of how it was initially designed. Take for example Delphi which can compile millions of lines of code in under a minute or something ridiculous. Then we have D, Go, Rust, and such, they compile rather large codebases that would take C++ a good 30 minutes on high end hardware of today in shorter spans of time (not as familiar with how fast Rust compiles, but I know Go and D do pretty nicely, especially if you enable concurrency for D), which probably takes those same 30 minutes on high end hardware from about a decade ago. Sadly from what I have heard C / C++ has to run through source files numerous times before it finally compiles the darn thing into anything meaningful. Facebook made a preprocessor in D to speed things up for them, it technically didn't have to be coded in D, but Walter did write the preprocessor for them, so he gets to pick whatever language.
- anchpop 7y agoRust doesn't compile very fast unfortunately, but it's being worked on. General wisdom says it's about as fast as Clang but comparing compile speeds across languages in a meaningful way is difficult
- giancarlostoro 7y agoFair enough, thanks for that, I wasn't sure, all my Rust programs have been small enough to where I havent noticed. I wonder if it would of made sense for Rust to consider this earlier on in the same way that Pascal did. I believe I heard Pascal was designed to be parsed easily by machine code.
- steveklabnik 7y agoParsing is not the reason why it takes a while to compile.
- Sharlin 7y ago"Parsing" was probably not the best choice of word on the GP's part, but they meant that Pascal was specifically designed to be implementable with a naive single-pass compiler; of course that would exclude many optimizations we take for granted these days.
- pbhjpbhj 7y agoMy first Linux, Slackware, took me a week to download (Slackware), was on something like 12 disks. I compiled a kernel, took two days. That was on a second-hand Pentium-S. I probably wasn't doing it right.