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

Should I enable dynamic linking when using mold? #1085

Open
Khayet opened this issue Mar 9, 2024 · 1 comment
Open

Should I enable dynamic linking when using mold? #1085

Khayet opened this issue Mar 9, 2024 · 1 comment
Labels
A-Book C-Correction A typo or factual issue in what we've written

Comments

@Khayet
Copy link

Khayet commented Mar 9, 2024

How can Bevy's documentation be improved?

Hi, I stumbled over some conflicting advice in the section on fast compiles:

https://bevyengine.org/learn/quick-start/getting-started/setup/#enable-fast-compiles-optional

Of course I want to have the fastest compiles possible, so I'm enabling everything that the docs recommend, including

  • enabling dynamic linking
  • using mold instead of lld or the default linker

..but then later there's a note that says

"NOTE: Disabling bevy/dynamic_linking may improve the performance of this linker."

As a new user this is confusing to me - do you recommend to NOT use dynamic linking with mold or should I use dynamic linking with mold. I assume that the actually optimal setting depends on my system and my code but as a newbie, I have no way to find that out, so I would appreciate it if the docs just gave a clear recommendation like "Use dynamic linking if you are linking with lld, do not enable dynamic linking if you are linking with mold.".

Thank you!

@TrialDragon
Copy link
Member

I believe the vague wording is because there hasn't been solid performance benchmarks to prove either way. Anecdotally when running dynamic linking, and no dynamic linking, with mold on my (small) project it generally came out to:

2 mins to build initially on both (with a random one where dynamically linking took 3),
0.14 seconds to build with no changes on both,
2 seconds to rebuild changes with dynamic linking, 18 seconds to rebuild changes without dynamic linking.

So, it's a your mileage may vary scenario; the person who initially wrote that probably got results that were the opposite of mine. (We should probably re-word that on the site though since you're not the first to be confused).

@alice-i-cecile alice-i-cecile transferred this issue from bevyengine/bevy Mar 9, 2024
@alice-i-cecile alice-i-cecile added A-Book C-Content C-Correction A typo or factual issue in what we've written and removed C-Content labels Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Book C-Correction A typo or factual issue in what we've written
Projects
None yet
Development

No branches or pull requests

3 participants