-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Description
Bevy version
0.16.1
Relevant system information
cargo 1.88.0 (873a06493 2025-05-10)
Windows 11
What's performing poorly?
I've been dealing with poor compile times on my main workspace project. I've been debugging it a bit and I believe the root cause was a lot of time spent in compute_debuginfo_type_name
.
In my project, I use functions that return impl Bundle
heavily, sometimes in a nested fashion:
fn make_bundle() -> impl Bundle {
/* ... */
}
With some profiling, I noticed that the compiler is spending an awful long time in compute_debuginfo_type_name
:

So I did some quick refactoring to reduce my usage of impl Bundle
. This drastically reduced the time spent in compute_debuginfo_type_name
.

This dropped the compilation time of my crate to about half of what it used to be.
Thing is, I don't think this is my code calling std::any::type_name
on these bundles. My assumption is that this is because of the debug print messages for impl Bundle
types, but I'm not 100% sure.
Mainly opening this thread to discuss any potential optimizations.
Raw trace files:
Before: https://drive.google.com/file/d/1hx6l87tnrcgKoFbIselbbjWtAXlRGZgo/view?usp=drive_link
After: https://drive.google.com/file/d/1NmRejNCJISYwFoZb4f_v6-etdttyURy3/view?usp=drive_link