My hardware is an 11th gen Intel i7 (4-core, 8-thread) laptop. I included time to build but did excluded time to fetch dependencies. I measured real (wall) time and user time with time(1). I compiled clean release builds in both cases (I think). Here's what I found:
uutils/coreutils: I fetched dependencies (`cargo fetch`) ahead of time, then just ran `time cargo build --release` to build everything. This took 1m37s wall time, 4m19s user time. It looked like about half of that time was spent compiling the `coreutils` multicall (Busybox-style) binary itself, after compiling all the individual `uu_*` utilities (`uu_cat`, etc.).
GNU coreutils: I fetched dependencies (`git submodule update --init --recursive`) ahead of time, then read `README-hacking`, which indicates a three-step build process:
time ./bootstrap: 2m42s wall time, 4m32s user time
time ./configure: 0m36s wall time, 0m21s user time
time make -j8: 0m21s wall time, 2m24s user time
I don't know exactly what ./bootstrap is doing? It's a 1500-line shell script. It does seem to download pofiles at the start, so knock 10s off its runtime. A lot of its time seems to be spent in gnulib-tool(1); it runs aclocal(1) and m4(1) near the end, but I didn't notice it running cc(1). (I'm just watching top.) Maybe someone who knows this codebase better can comment how to fairly compare these.So, if we're measuring "time for clean release build on a new dev's machine (not including network fetches)", we're looking at ~200s for GNU coreutils and 97s for uutils/coreutils. If we discount ./bootstrap for whatever reason, that goes down to 57s vs. 97s. Either way, it seems within a factor of roughly 2, with the winner going one way or another depending on how you count.
Methodology comments welcome.
Using a different linker (like mold) might change that, if most of the time is spent linking everything together.
$ readelf -p .comment ./target/release/coreutils
String dump of section '.comment':
[ 0] rustc version 1.74.0 (79e9716c9 2023-11-13)
[ 2c] GCC: (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0
[ 57] mold 2.3.3 (49066ea329979c3187556091ba62421594799fd1; compatible with GNU ld)
[ a6] GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
I may have done something wrong; let me know if you get substantially different results.(Edited for new timings with mold 2.3.3 instead of 1.0.3.)
Can this power be learned?