Technology
Developer analyzes Bun compile times using a custom Linux build tracing tool
Hacker News reports that a new open-source profiler attributed Bun's compile differences between Zig and Rust to optimization settings.
The short version
- A developer created the open-source Linux tracing tool buildprof to test claims that Bun's Rust build was over five times faster than its older Zig build.[Hacker News]
- Benchmarking showed the Zig build took 24 minutes and 24 seconds versus 5 minutes and 40 seconds for Rust, with linker execution under Full LTO occupying over 16 minutes of the Zig build.[Hacker News]
- Switching the Zig setup to ThinLTO and rebuilding WebKit and ICU reduced its compilation time to 15 minutes and 11 seconds.[Hacker News]
Key facts
- The developer created buildprof, an open-source tool for tracking compile times and process hierarchies on Linux.[Hacker News]
- Jarred Sumner claimed Bun's new Rust build ran more than five times faster on Linux than its previous Zig build.[Hacker News]
- In a single-machine CI replay, the Zig build required 24 minutes and 24 seconds compared to 5 minutes and 40 seconds for Rust.[Hacker News]
- Bun's Zig build utilized Full LTO while the Rust implementation used ThinLTO, leaving the Zig linker running alone for over 16 minutes.[Hacker News]
- Rebuilding WebKit and ICU dependencies with compatible ThinLTO flags lowered the Zig build time to 15 minutes and 11 seconds.[Hacker News]
What remains uncertain
- The author suspects, but could not prove, that Zig compiling via a single module instead of over 90 Rust crates caused slower linking.[Hacker News]
Sources
Outlet counts describe coverage, not independent confirmation. Reports may share a wire service or original source.