Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve compile times #1316

Open
Wumpf opened this issue Feb 15, 2023 · 8 comments
Open

Improve compile times #1316

Wumpf opened this issue Feb 15, 2023 · 8 comments
Labels
⏱ build-times compilation times 🧑‍💻 dev experience developer experience (excluding CI) enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed 🎄 tracking issue issue that tracks a bunch of subissues

Comments

@Wumpf
Copy link
Member

Wumpf commented Feb 15, 2023

(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:

  • replace clap with something simpler, like pico-args
  • replace sha2 with a simpler hash
  • replace chrono with time
  • replace image crate with https://github.com/etemesi254/zune-image
  • re_web_server should be able to use something must simpler than hyper+tokio
  • replace lazy_static with once_cell ?
  • remove strum
  • enumset can be replaced with something simpler (maybe by macro_rules!)
  • reduce naga features?
  • crossbeam (std::sync::mpsc is now using the same implementation) - though crossbeam compiles in 2s, so probably not worth it

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 Wumpf added enhancement New feature or request 🧑‍💻 dev experience developer experience (excluding CI) labels Feb 15, 2023
@Wumpf
Copy link
Member Author

Wumpf commented Feb 15, 2023

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
Copy link
Member Author

Wumpf commented Feb 15, 2023

very similar results on second run

@emilk emilk added the 🎄 tracking issue issue that tracks a bunch of subissues label Feb 15, 2023
@Wumpf
Copy link
Member Author

Wumpf commented Feb 17, 2023

Getting rid of zstd is somewhat hard - it is just really really good it seems EmbarkStudios/puffin#130

@emilk
Copy link
Member

emilk commented Apr 17, 2023

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
Copy link
Member

emilk commented May 13, 2023

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
Copy link
Member

emilk commented May 20, 2023

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

@emilk
Copy link
Member

emilk commented Dec 11, 2023

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

78.8s and 353 dependencies

image

@emilk emilk added this to the Spring Cleaning milestone Apr 24, 2024
@Wumpf
Copy link
Member Author

Wumpf commented Jun 18, 2024

Status update: On c5f8176 (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!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⏱ build-times compilation times 🧑‍💻 dev experience developer experience (excluding CI) enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed 🎄 tracking issue issue that tracks a bunch of subissues
Projects
None yet
Development

No branches or pull requests

2 participants