This benchmark is conducted by compiling LLVM trunk (781eabeb40b8e47e3a46b0b927784e63f0aad9ab) with:
cmake \
-Bbuild \
-Hllvm \
-DCMAKE_BUILD_TYPE=Debug \
-DLLVM_CCACHE_BUILD=ON \
-DLLVM_OPTIMIZED_TABLEGEN=ON \
-DLLVM_PARALLEL_LINK_JOBS=1 \
-DLLVM_USE_LINKER=lld \
-G Ninja
Before each build, the tree is wiped. But we do an initial build till completion, so the ccache cache is populated and the resulting time will mainly reflect the linking step.
The compilation is done in an ubuntu 22.04 container on a server with AMD EPYC 7401P (48 logical cores) and 128GB memory.
lld
is set up by using official ubuntu apt release. ld.lld
version:
Ubuntu LLD 15.0.6 (compatible with GNU linkers)
mold
is set up by using official github release tarball. ld.mold
version:
mold 1.8.0 (a49a201695edd294ed4d97231c9dc5a994275dd2; compatible with GNU ld)
For fairness, we also compile mold
sans mimalloc
using cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DMOLD_USE_MIMALLOC=OFF -DCMAKE_INSTALL_PREFIX="$HOME/.local" -G Ninja && cmake --build build --target install
.
The time is listed as follows:
real 8m33.229s
user 46m55.646s
sys 28m5.171s
real 7m17.948s
user 24m0.380s
sys 4m48.670s
real 7m31.060s
user 23m48.600s
sys 4m50.908s