Skip to content

Latest commit

 

History

History
204 lines (131 loc) · 7.73 KB

File metadata and controls

204 lines (131 loc) · 7.73 KB

Benchmarks

This page contains benchmarks of linking various programs. The benchmarks are just running the linker, not the compiler. All benchmarks are run on an AMD Ryzen 9 9955HX 16-Core (32 thread) processor with 92GiB of RAM. The output file is always on tmpfs.

For benchmarks run on David's 2020 era laptop which were used in benchmark reports prior to 2026, see lemp9.md.

The benchmarks include several other linkers for Linux as well as several recent versions of Wild. This allows us to both compare between linkers and to see how Wild's performance is changing over time.

We only include GNU ld (BFD) in a few of the benchmarks since it's generally a lot slower than the other linkers and including it messes up the scaling on the charts. It does do OK on memory consumption though.

The little white ticks on each bar are 99% confidence intervals and show how accurate we think our mean value is. i.e. if we reran the benchmark 100 times, we'd expect that 99 times we'd get a mean within that the range of the white tick.

Execution time

chrome - time

We start with linking the Chrome web browser (technically Chromium). This is a very large codebase and a pretty large binary.

Benchmark of linking chrome

chrome-crel - time

CREL relocations are a new format for relocations that is significantly more compact. Wild has supported these for a couple of releases, however we hadn't benchmarked non-trivial programs with CREL relocations until just prior to the 0.8.0 release. It turned out that we had a bug that caused memory usage to blow up, making it impractical to link non-trivial programs. This is now fixed, so we benchmark CREL relocations from 0.8.0. Chrome uses CREL relocations by default.

Benchmark of linking chrome-crel

chrome-arm64 - time

Time to link chrome-arm64

mold-crel - time

For a smaller CREL benchmark, we link Mold, with the compiler configured to emit CREL relocations (not the default configuration).

Benchmark of linking mold-crel

clang-debug - time

Clang with debug info has massive quantities of debug strings that need to be deduplicated. So link time here is dominated by how quickly we can deduplicate strings.

Benchmark of linking clang-debug

clang-debug-strip - time

This benchmark is the same as the previous one, but with the extra flag --strip-debug. It shows to what extent linkers are able to take advantage of the fact that they don't need to emit the debug info that's in the input files.

Time to link clang-debug-strip

clang-release - time

Benchmark of linking clang-release

rust-analyzer - time

Benchmark of linking rust-analyzer

rust-analyzer-riscv - time

Benchmark of linking rust-analyzer-riscv

zed-release - time

Benchmark of linking zed-release

zed-debug - time

Time to link zed-debug

bevy-dylib - time

Benchmark of linking bevy-dylib

librustc-driver - time

Rustc is quite large. Most of the code however goes into librustc-driver. Rustc itself it pretty quick to link, so we only benchmark linking of librustc-driver.

Benchmark of linking librustc-driver

ripgrep - time

Ripgrep is a popular grep alternative. It's got a pretty lean dependency tree, so is fairly fast to link.

Benchmark of linking ripgrep

wild - time

Wild linking itself.

Benchmark of linking wild

wild-riscv - time

Wild linking a risc-v version of itself. We're still doing the linking on x86_64, but the binary being produced is for risc-v.

Benchmark of linking wild-riscv

wild-aarch64 - time

Time to link wild-aarch64

wild-loongarch64 - time

Time to link wild-loongarch64

wild-debug - time

Time to link wild-debug

Wild linking itself with linker-plugin LTO. This is much much slower, since the linker plugin ends up doing heaps of work during linking.

wild-lto - time

Time to link wild-lto

rust-hello-world - time

Now a couple of trivial, hello-world programs. One written in Rust and one written in C.

Benchmark of linking rust-hello-world

c-hello-world - time

Benchmark of linking c-hello-world

Memory consumption

We care not just about execution time, but also memory consumption. Here are the same benchmarks as above repeated, but this time measuring the peak memory consumption of the linkers.

chrome - memory

Memory consumption while linking chrome

chrome-crel - memory

Memory consumption while linking chrome-crel

chrome-arm64 - memory

Memory consumption while linking chrome-arm64

mold-crel - memory

Memory consumption while linking mold-crel

clang-debug - memory

Memory consumption while linking clang-debug

clang-debug-strip - memory

Memory consumption while linking clang-debug-strip

clang-release - memory

Memory consumption while linking clang-release

rust-analyzer - memory

Memory consumption while linking rust-analyzer

rust-analyzer-riscv - memory

Memory consumption while linking rust-analyzer-riscv

zed-release - memory

Memory consumption while linking zed-release

zed-debug - memory

Memory consumption while linking zed-debug

bevy-dylib - memory

Memory consumption while linking bevy-dylib

librustc-driver - memory

Memory consumption while linking librustc-driver

ripgrep - memory

Memory consumption while linking ripgrep

wild - memory

Memory consumption while linking wild

wild-riscv - memory

Memory consumption while linking wild-riscv

wild-aarch64 - memory

Memory consumption while linking wild-aarch64

wild-loongarch64 - memory

Memory consumption while linking wild-loongarch64

wild-debug - memory

Memory consumption while linking wild-debug

wild-lto - memory

Memory consumption while linking wild-lto

rust-hello-world - memory

Memory consumption while linking rust-hello-world

c-hello-world - memory

Memory consumption while linking c-hello-world