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

Suggest -Zrun-dsymutil-no for macOS fast compiles #552

Merged
merged 1 commit into from
Sep 25, 2020
Merged

Suggest -Zrun-dsymutil-no for macOS fast compiles #552

merged 1 commit into from
Sep 25, 2020

Conversation

lberrymage
Copy link
Contributor

This keeps original object files around after compilation in the event that debug information is needed.

Resolves #527

@karroffel karroffel added A-Build-System Related to build systems or continuous integration O-MacOS Specific to the MacOS (Apple) desktop operating system labels Sep 22, 2020
Copy link
Member

@CleanCut CleanCut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is amazing! By far the single-most effective incremental compilation speedup I've ever seen in debug mode!

I tested this out on a 16-core Mac Pro and incremental compilation in debug-mode decreased from an average of 7.74s to 2.16s. The difference is HUGE! Over 3x faster!

Clean compile time in debug mode decreased from an average of 53.83s to 46.71s. Looks like about the same absolute time savings, but much more modest percentage-wise here.

Given the time savings is fixed, I expect slower machines will see a smaller percentage savings, but still it's by far the biggest single improvement I've seen.

--

It is interesting to note that this has no measurable affect in release mode, either for clean compiles or incremental compiles. Even more interesting, incremental compiles in release mode averaged 1.82s (with or without the setting). Up until now I had assumed release mode would have slower incremental compiles.

Clean compiles in release mode are somewhat slower (62s), but that's to be expected.

CHANGELOG.md Outdated Show resolved Hide resolved
@@ -2,6 +2,10 @@

## Unreleased

### Added

- [Another fast compile flag for macOS][552]
Copy link
Member

@CleanCut CleanCut Sep 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- [Another fast compile flag for macOS][552]
- [Another fast compile flag for macOS that gives incremental compilation a big boost!][552]

@CleanCut
Copy link
Member

I went ahead and updated the config in bevy_template based off of this. Though, I'm going to be running my stuff with --release most of the time now, so ironically this config won't help me much. 😛

@cart - this one's worth merging.

This keeps original object files around after compilation in the event that
debug information is needed.
@lberrymage
Copy link
Contributor Author

Thanks a bunch! But give bjorn3 all the credit for this one; I just saw his issue, looked into it, and whipped up a PR. Glad to see it makes a big difference!

@bjorn3
Copy link
Contributor

bjorn3 commented Sep 23, 2020

Even more interesting, incremental compiles in release mode averaged 1.82s (with or without the setting). Up until now I had assumed release mode would have slower incremental compiles.

What if you compile only dependencies with optimizations and without debuginfo? You can use [profile.dev.package.crate_name] to chnage the profile for just a single crate. See for example https://github.com/bjorn3/rustc_codegen_cranelift/blob/e5b2b1ba8101bc9d5da6fb05e669fc8f9d784368/Cargo.toml#L41

@cart
Copy link
Member

cart commented Sep 25, 2020

Oooh this is really nice. im going to merge this as its a clear win, but feel free to follow up on @bjorn3's comment with another pr if it pans out.

@cart cart merged commit 3ca0a2b into bevyengine:master Sep 25, 2020
@lberrymage lberrymage deleted the fast-macos-no-dsymutil branch September 25, 2020 01:54
@CleanCut
Copy link
Member

Using the following in my Cargo.toml to compile dependencies with full optimizations and no debug symbols, but compile the project itself with no optimizations and with debug symbols decreases incremental time further to 1.38s! I don't see any "static" way to configure this, since the stanza re-enabling debug mode for the project itself needs to contain the project name (punchball, in this case), but I plan to add support for configuring this to bevy_template later today.

# Compile all the *dependencies* in optimized release mode even if `--release` is not passed in
[profile.dev]
opt-level = 3
debug = false

# But compile the project itself in debug mode if `--release` is not passed in
[profile.dev.package.punchball]
opt-level = 0
debug = true

@CleanCut
Copy link
Member

...but I plan to add support for configuring this to bevy_template later today.

CleanCut/bevy_template#2

mrk-its pushed a commit to mrk-its/bevy that referenced this pull request Oct 6, 2020
This keeps original object files around after compilation in the event that
debug information is needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Build-System Related to build systems or continuous integration O-MacOS Specific to the MacOS (Apple) desktop operating system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggest -Zrun-dsymutil=no for faster compilation on macOS
5 participants