Speeding up compile times with LLD or mold linker #11903
Unanswered
RaoulLuque
asked this question in
Q&A
Replies: 1 comment
-
I don't have any experience with mold, but I am certain that LLD and MOLD are intended to make recompiles (after changes in your code) marginally faster. On my system with LLD the recompiles are roughly 5-10 seconds faster. I've went through the setup page you've linked this is what was mentioned:
emphasis on "maximally fast iterative compiles". So yeah, it's meant to make recompiles (using your terminology) faster rather than making the initial compilation faster. |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
As explained at the bottom of the setup page in the bevy getting started guide, using either LLD or mold as a linker should increase the compile times (drastically)?
I have tried this for this little test game that I have written and doing a fresh cargo run (after deleting the target folder) gives me a compile time of 8 minutes and an even slower compile time of 8 minutes and 30 seconds when using LLD.
For this I have run
sudo apt-get install lld
as suggested for ubuntu users and added the following to my .cargo/config.toml file:
For that I also had to install clang with this command (since it wouldn't compile otherwise so I guess it actually used LLD at least):
sudo apt install clang
Maybe it's just the project that doesn't seem to benefit from LLD or am I doing something wrong here? Also 8 minutes and 30 seconds seems like quite a long time for a fresh compile. Of course the re-compiles after changes in my code take about 5/10 seconds so that's really fine.
I have tried the same with the mold linker and added the following to my .cargo/config.toml instead:
Additionally as explained in the Mold repo I have checked if the binary is actually linked with mold and it is indeed so that shouldn't be the issue:
Beta Was this translation helpful? Give feedback.
All reactions