-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Bevy depends on 4 different versions of the windows crate #11244
Comments
|
it's known, Bevy CI used to fail on this... but not much we can do as the dependencies don't have all the same lifecycle. it should "only" impact the build time and the bin size, not performance |
Well, feel free to close this. Just wanted to raise for awareness as r-a is kind of limited in what it can do here currently. I have a small idea that will get memory waste from this down by a third, gonna try implementing that next week, but that still leaves a lot of memory. |
Okay, rust-lang/rust-analyzer#16307 will get rid of the extra in memory source file stores, so this can be closed if you don't think this is a problem for you to track. I would seriously recommend though trying to get rid of |
N.b.: that gets rid of the extra copy, but we still store all the source code of the four crates in memory (as described above). |
At the very least, |
I got curious so ran cargo bloat: on my machine the example 2d_gizmos, windows ends up taking 0.1% of the file size, 107.7KiB on my machine. Size in binary is not the main point of this issue but it's interesting nonetheless. Details
cargo bloat -n 250 --crates --example 2d_gizmos File .text Size Crate Note: numbers above are a result of guesswork. They are not 100% correct and never will be. |
We're currently down to 3 copies (2 outdated)
|
Bevy version
Relevant system information
on windows 10
What's performing poorly?
This is not necessarily a regression, but it was the template that fits best. Bevy currently depends on 4 versions of the windows crate, namely
0.44.0
,0.46.0
,0.48.0
and0.52.0
:This is a pretty big issue for rust-analyzer users at least (and I assume not too nice for compilation speed either). Why? Well, these crates are absolutely massive, and due to how rust-analyzer works (for the time being, ideally it wouldn't), rust-analyzer currently loads every source file into memory at start up for speed (and unfortunately duplicates this for normalizing file endings). This wastes a ton of memory due to the windows crate being enormous in source code size (a whopping
1.5
-1.6
gb!), and this is without any other related computed information like early name resolution which could be pretty big for these crates as well!Now this is not a problem for bevy itself, but certainly for the user experience of people working with the engine in rust-analyzer so I figured I should bring this up.
Additional information
rust-lang/rust-analyzer#16301
The text was updated successfully, but these errors were encountered: