Add -Zcache-proc-macros flag to config_fast_builds.toml#24595
Open
perry-blueberry wants to merge 1 commit into
Open
Add -Zcache-proc-macros flag to config_fast_builds.toml#24595perry-blueberry wants to merge 1 commit into
perry-blueberry wants to merge 1 commit into
Conversation
Contributor
|
Welcome, new contributor! Please make sure you've read our contributing guide, as well as our policy regarding AI usage, and we look forward to reviewing your pull request shortly ✨ |
alice-i-cecile
approved these changes
Jun 11, 2026
Author
|
What the hell, I was creating this on my GF's laptop (Macbooks are really nice for incremental compilation!) and it somehow linked to her account. Well that's a bit embarrassing 😅 I guess she won't mind though 😆 Edit: Well not so weird now that I think about it. I only added SSH keys and not my own user. Anyway it's bit funnier this way lol |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Add flag to improve incremental build times.
Solution
Add the flag
-Zcache-proc-macrosto config_fast_build_times.config so that a user can easily enable it if they want to.Testing
I did a few tests back and forth with and without this on Linux. I saw consistent incremental build time gains, maybe around 5%. I've also been running with this on aarch64 Mac so it compiles there as well. I haven't tested this on Windows.
I unfortunately did not save the run results I gathered.
Another thing to note is that this might slightly increase clean compilation times but only by a small fraction (maybe a couple of percent, not sure). I'm guessing this might be a hot path in the compiler so branching on this condition every time could possibly make it slightly slower? Or it might have just been noise.
The claim that it improves incremental by 5-10% is based on my own experiments and the original rust PR that states
Maybe we shouldn't give a number at all? It might even be the case that a user doesn't notice this a lot of the time. My suspicion is that this would make more of a difference if a crate has many and large derive macros, relative to the rest of the code size.
Also I asked about this in the Discord server, but this will probably return stale results if a proc macro if there are side effects. Does Bevy have any side effects in proc macros?