Improve compile times
Author: WumpfCreated Feb 15, 2023Updated Sep 7, 2026
Labelsenhancementgood first issuehelp wanted🎄 tracking issue🧘 kaizen⏱ build-times
(edited by @emilk)
Improve build times, and aspire to reduce number of dependencies and code bloat in the process.
Some useful tools include:
cargo clean && cargo build --timings -p reruncargo treecargo machete- https://github.com/google/bloaty
- https://github.com/RazrFalcon/cargo-bloat
- https://github.com/dtolnay/cargo-llvm-lines
cargo udepsto find unused dependencies
See also:
Reducing dependencies
Some ideas:
- replace
clapwith something simpler, like pico-args - replace
sha2with a simpler hash - replace
chronowithtime - replace
imagecrate with https://github.com/etemesi254/zune-image re_web_servershould be able to use something must simpler thanhyper+tokio- replace
lazy_staticwithonce_cell? - remove
strum enumsetcan be replaced with something simpler (maybe bymacro_rules!)- reduce
nagafeatures? crossbeam(std::sync::mpscis now using the same implementation) - thoughcrossbeamcompiles in 2s, so probably not worth it
Done:
- https://github.com/rerun-io/rerun/pull/1425
- https://github.com/rerun-io/rerun/pull/1407
- https://github.com/rerun-io/rerun/pull/1406
Other tasks
- #347
- Track build time and number of dependencies over time like we do for benchmarks
- Add
cargo-denyto the CI of other crates, likearboard, to prevent duplicate dependencies of e.g.nix - In puffin, add support for
lz4_flex: https://github.com/EmbarkStudios/puffin/pull/130#issuecomment-1495641210
Other
We have some instructions for improving build times in https://github.com/rerun-io/rerun/blob/main/BUILD.md#improving-compile-times
Source: rerun-io/rerun