rerun-io / rerun

Visualize streams of multimodal data. Free, fast, easy to use, and simple to integrate. Built in Rust.
https://rerun.io/
Apache License 2.0
7.08k stars 354 forks source link

Improve compile times #1316

Open Wumpf opened 1 year ago

Wumpf commented 1 year ago

(edited by @emilk)

Improve build times, and aspire to reduce number of dependencies and code bloat in the process.

Some useful tools include:

See also:

Reducing dependencies

Some ideas:

Done:

Other tasks

Other

We have some instructions for improving build times in https://github.com/rerun-io/rerun/blob/main/BUILD.md#improving-compile-times

Wumpf commented 1 year ago

rebuild on dev with M1 max via cargo clean && cargo build --timings

cargo-timing-20230215T130337Z.html.zip

image

Quite surprised about zlib being so slow here! Investigating alternatives!

image
Wumpf commented 1 year ago

very similar results on second run

Wumpf commented 1 year ago

Getting rid of zstd is somewhat hard - it is just really really good it seems https://github.com/EmbarkStudios/puffin/pull/130

emilk commented 1 year ago

I think we can switch from zstd to lz4_flex. To get the benefits we must first remove zstd from our puffin dependency:

EDIT:

emilk commented 1 year ago

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

image
emilk commented 1 year ago

This halves compilation times for users only using the rerun crate as a logging library:

emilk commented 11 months ago

Things has improved - cargo clean && cargo build --timings -p rerun on my M1 MacBook Pro:

78.8s and 353 dependencies

image

Wumpf commented 5 months ago

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

image

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!)