4 ms·
Tangential: TIL you can compile the Linux kernel in < 1 minute (on top-spec hardware). Seems it’s been a while since I’ve done that, because I remember it being
by sgarland 1y ago
Tangential: TIL you can compile the Linux kernel in < 1 minute (on top-spec hardware). Seems it’s been a while since I’ve done that, because I remember it being more like an hour or more.
- bornfreddy 1y agoI remember I was blown away by some machine that compiled it in ~45 minutes. Pentium Pro baby! Those were the days.
- sgarland 1y agoMy memory must be faulty, then, because I was mostly building it on an Athlon XP 2000+, which is definitely a few generations newer than a Pentium Pro. I’m probably thinking of various other packages, since at the time I was all-in on Gentoo. I distinctly remember trying to get distcc running to have the other computers (a Celeron 333 MHz and Pentium III 550 MHz) helping out for overnight builds. Can’t say that I miss that, because I spent more time configuring, troubleshooting, and building than using, but it did teach me a fair amount about Linux in general, and that’s definitely been worth it.
- kelnos 1y agoLinux kernel compilation time depends heavily on what you're compiling though. You can have wildly different compilation times just by enabling or disabling some drivers or subsystems.
- machomaster 1y agoLet's also not forget that kernel was not stagnant, but grew a lot over the years.
- kelnos 1y agoAlso true! Hard to say which was moving faster, though: CPU speed increases & RAM amount increase, or the additional code and complexity written into the kernel.
- bpye 1y agoYep - I have a 9950X desktop. Building the kernel as part of NixOS builds almost every possible option as a module - for ARM64 that takes something like 15 minutes.
- mwpmaybe 1y agoPainful memories of trying to build the kernel on my 486DX2/50, letting it run overnight and waking up to a compile-time error or non-booting kernel...
- dahart 1y agoSpinning hard drives were soooo slow! Maybe very roughly an order of magnitude from SSDs and an order of magnitude from multi-core?
- znpy 1y agoi think you nailed the centrail point. rotational disks usually top up at ~85 MB/sec, with seek time being up to 12 msec for consumer drives and ~6 msec for enterprise drives (15k rpm). ssd could saturate the sata bus and would top at 500-550 MB/sec, with essentially no seek time. latency wold be anything between 50 and 250 microseconds (depending on the operation). nvme disks instead can sometimes full utilise a pci-e lane and reach multiple gigabytes/second in sequential read (ie: pci-e gen5 nvme disks can peak at 7 GB/sec) with latencies as low as 10–30 microseconds for reads and 20–100 microseconds for writes. As compiling the kernel meant/means doing a lot of i/o on small files, you can see why disk access is a huge factor. A friend of mine did work on LLVM for his PhD... The first thing he did when he got funding for his phd was getting a laptop with as much memory as possible (i think it was 64gb on a dell workstation, at the time) and mount his work directory in tmpfs.
- JonChesterfield 1y agoI'd like to know why making debian packages containing the kernel now takes substantially longer than a clean build of the kernel. That seems deeply wrong and rather reduces the joy at finding the kernel builds so quickly.
- kelnos 1y agoAre you building the Debian kernel with the same .config as when you build the kernel directly? If not, that's probably why. A Debian kernel build will build basically everything, mostly as modules. A kernel tailored for your specific hardware and needs will be much faster to build. Also disabling building the _dbg package for the Debian build will significantly speed things up. Building that package takes a strangely long amount of time.
- burnt-resistor 1y agoIn 2003, Egenera boxes could compile Linux in around 15 seconds. Even my dual 7402 with 96 threads and 512 GiB of RAM can't compile a maximal Linux config x86 build in RAM in under 3 minutes. What I find helps repeated builds is maintaining a memcache server instance for sccache.
- mwpmaybe 1y agoI suspect that's a very slimmed-down .config and probably only e.g. `make bzImage`, versus something like a Debian kernel .config with modules, headers, etc. A full Ubuntu kernel takes quite a bit longer on my 5950X, which is admittedly quite a bit slower than a 9950X but still no laggard. I'll time it and update this comment later... ETA: After dropping caches it took 18m40s to build Ubuntu mainline 6.16.3 with gcc-14 on my 5950X, with packages for everything including linux-doc, linux-rust-lib, linux-source, etc. I'd expect the same operation to take about 11m on a 9950X. It's also not clear whether OP used Clang or GCC to build the kernel. Clang would be faster.