by diggan · 2y ago · 0 comments
> cargo build --release 23.93s user 22.85s system 66% cpu 1:09.88 total
> cargo +nightly build -Zcodegen-backend 23.52s user 21.98s system 68% cpu 1:06.86 total
Seems just marginally faster than a normal release build. Wonder if there is something particular with Bevy that makes this so? The author of the article mentions 40% difference in build speed, but I'm not seeing anything near that.
Edit: just realized I'm caching my release builds with sccache and a local NAS, hence the release builds being as fast as Cranelift+debug builds. Trying it again with just debug builds and without any caching:
> cargo +nightly build 1997.35s user 200.38s system 1878% cpu 1:57.02 total
> cargo +nightly build -Zcodegen-backend 280.96s user 73.06s system 657% cpu 53.850 total
Definitely an improvement once I realized what I did wrong, about half the time spent compiling now :) Neat!
Even cooler would be if LLVM itself could also cache internal expensive parts of compilation and optimization across process instances. That would make a huge impact in cutting down incremental builds.
Isn't incremental compilation already like that?
Here is a direct link: https://github.com/bevyengine/bevy