Developer Voices podcast question: Tips and tricks to speed up compilation time #2469
laundmo
started this conversation in
Ideas/Feedback
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, i just saw the Developer Voices podcast with Keavon and Dennis, where @Keavon asked for tips/tricks to speed up the development workflow regarding Rust compile times (specifically, at 1:02:54). I have some ideas which work for other projects, though i have not compiled graphite yet - i can't say any of these will actually help, though i plan on testing it next time i get the chance.
dylib
to allow for less code needing to be statically linked. source (kinda)mold
linker. I see you have a shell.nix which usesmold
as a linker, but nothing else. (note: the mold linker is entirely separate from the npm/node tool also called mold)-Zthreads=0
(automatic thread count) or-Zthreads=8
(important to test this, it can be slower)opt-level=3
by setting it in[profile.dev.build-override]
and[profile.dev.package.syn]
(or just..package."*"
for setting it for all dependencies)Of course it always makes sense to try various settings with
cargo build --timings
to see where time is spent, and maybecargo build --verbose
which logs out reasons why a crate might be re-built (Fresh/Dirty).The above represent the options i've used across various projects, mostly Bevy (with these, i get 0.5s incremental compile times for bevy-based projects!). Theres various other ways to improve compile times, heres a few helpful links. These also discuss some code changes, which i don't have experience with:
Beta Was this translation helpful? Give feedback.
All reactions