Open Wumpf opened 1 year ago
rebuild on dev with M1 max via cargo clean && cargo build --timings
cargo-timing-20230215T130337Z.html.zip
Quite surprised about zlib being so slow here! Investigating alternatives!
very similar results on second run
Getting rid of zstd is somewhat hard - it is just really really good it seems https://github.com/EmbarkStudios/puffin/pull/130
I think we can switch from zstd
to lz4_flex
. To get the benefits we must first remove zstd
from our puffin
dependency:
EDIT:
Current state on my M1 MacBook Pro
sccache --stop-server && rm -rf /Users/emilk/Library/Caches/Mozilla.sccache && sccache --start-server
cargo clean && cargo build --timings -p rerun
2m 12s
This halves compilation times for users only using the rerun
crate as a logging library:
Things has improved - cargo clean && cargo build --timings -p rerun
on my M1 MacBook Pro:
78.8s and 353 dependencies
Status update: On c5f817686c6a1b8723ddeee25a9aed0ff4fa1e92 (somewhere between 0.16 and 0.17 ;)
M1max MacBook Pro (very similar to emils machine above) 66.5s and 336 dependencies
re_types
is the biggest unit with quite some distance, otherwise the next logical thing would be to try to get rid of serde (should be in reach for the sdk!)
(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 rerun
cargo tree
cargo machete
cargo udeps
to find unused dependenciesSee also:
Reducing dependencies
Some ideas:
clap
with something simpler, like pico-argssha2
with a simpler hashchrono
withtime
image
crate with https://github.com/etemesi254/zune-imagere_web_server
should be able to use something must simpler thanhyper
+tokio
lazy_static
withonce_cell
?strum
enumset
can be replaced with something simpler (maybe bymacro_rules!
)naga
features?crossbeam
(std::sync::mpsc
is now using the same implementation) - thoughcrossbeam
compiles in 2s, so probably not worth itDone:
Other tasks
347
cargo-deny
to the CI of other crates, likearboard
, to prevent duplicate dependencies of e.g.nix
lz4_flex
: https://github.com/EmbarkStudios/puffin/pull/130#issuecomment-1495641210Other
We have some instructions for improving build times in https://github.com/rerun-io/rerun/blob/main/BUILD.md#improving-compile-times