New Rust-Based 'Wild' Linker Shows Promise with 2x Speed Gains Over Mold

BigGo Editorial Team
New Rust-Based 'Wild' Linker Shows Promise with 2x Speed Gains Over Mold

The development landscape for linkers has seen a new entrant with the introduction of Wild, a Rust-based linker that's showing remarkable performance improvements over existing solutions. While still in early stages, Wild has captured the community's attention by achieving speeds up to twice as fast as Mold in certain scenarios, marking a significant advancement in linking technology.

Performance Breakthrough

Wild's initial benchmarks demonstrate impressive results, particularly in non-debug builds. Community testing reveals that Wild outperforms existing linkers significantly when linking rustc-driver and clang without debug information. This performance advantage has sparked considerable interest, especially given that Mold was previously considered the fastest option available.

It sounds like you're building from scratch. In that case, the majority of the time will be spent compiling code, not linking. The case for fast linkers is strongest when doing iterative development.

Linking Time Comparison (rustc-driver without debug info):

  • GNU ld (2.38): 20,774ms
  • gold (2.38): 6,796ms
  • lld (18.1.8): 1,601ms
  • mold (2.34.1): 946ms
  • wild (2024-11-30): 486ms

The Push for Incremental Linking

A key differentiator for Wild is its planned support for incremental linking, a feature notably absent from other modern linkers including Mold. The community has highlighted this as a significant gap in Linux development tools, particularly when compared to Microsoft's linker, which has supported incremental linking for decades. This capability could substantially improve development cycles by only relinking changed components rather than entire programs.

Rust's Role in Complex Systems

The choice of Rust for implementing Wild has generated significant discussion. Community members point out that Rust's strong type system and safety guarantees make it particularly suitable for managing the complexity of incremental linking. While some debate the necessity of another linker post-Mold's MIT relicensing, the focus on incremental linking and Rust's safety features presents a compelling case for Wild's development.

Current Limitations

Despite its promising performance, Wild is still in early development with several limitations. It currently only supports x86-64 on Linux, lacks LTO (Link Time Optimization) support, and doesn't yet implement its planned incremental linking feature. The community consensus suggests waiting before adopting Wild in production environments, though its development progress is being closely watched.

Current Wild Limitations:

  • x86-64 on Linux only
  • No incremental linking yet
  • Limited linker flags support
  • No linker scripts
  • No Mac/Windows support
  • No LTO support

Development Focus

The project's emphasis on development-time performance rather than production builds has resonated with developers. This focus aligns with the needs of modern development workflows, particularly in Rust projects where link times can become a bottleneck during iterative development.

Technical Notes:

  • LTO (Link Time Optimization): A compilation technique that allows the compiler to optimize across multiple source files
  • Incremental linking: A technique that only relinks changed portions of code rather than the entire program
  • RAII (Resource Acquisition Is Initialization): A programming idiom used in Rust for managing resources

Reference: Wild Linker