RC RANDOM CHAOS

Mold Linker Hits Up to 112x Faster Than GNU ld by Parallelizing Every Pass

· via Hacker News

Original source

Mold: A Massively Parallel Linker

Hacker News →

Linking—the build step that stitches compiled object files into a final executable or shared library—remains a stubborn bottleneck in the edit-compile-debug loop, especially for large C++ projects. A new paper argues the root cause is architectural: conventional linkers parallelize only narrow parts of the job, so most CPU cores sit idle while symbol resolution and archive processing stay tangled together and force serial execution.

Mold takes a clean-slate approach, deliberately decoupling those entangled stages so data parallelism can be applied uniformly across the whole pipeline rather than bolted onto one phase. The payoff is dramatic on real workloads: multi-gigabyte debug binaries link in at most a few seconds and frequently in under one, making mold 2.4x to 16.1x faster than the state-of-the-art lld and as much as 112x faster than the traditional GNU ld.

The more instructive finding is in the ablation study, which shows no single trick carries the win. The speedup is cumulative—every pass had to be parallelized for the numbers to hold. That reframes linker performance as a whole-pipeline design problem rather than a matter of optimizing the one slow stage, a useful lesson for anyone building latency-sensitive developer tooling.

Read the full article

Continue reading at Hacker News →

This is an AI-generated summary. Read the original for the full story.