-
Notifications
You must be signed in to change notification settings - Fork 124
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
Including crate increases build times by an order of magnitude #342
Comments
I had to learn that incremental compilation isn't enabled by default in release mode. Enabling it brought the build times back down to normal, but of course this is just masking the underlying problem. |
The primary culprits are: serde + serde_derive + gltf-json serde is known to be somewhat slow to compile. The derived serialization and deserialization code is monomorhpized, resulting in quite a lot of generated code. On the other hand, miniserde uses trait objects (dynamic dispatch), so much less code is generated (and will result in some performance loss). It may be worthwhile to explore |
gltf-json is the main slowdown from my testing. (with LLD on windows, 1.64 nightly) Release build of the whole gltf repo ( Release build of bevy where gltf-json doesn't seem to block any crates from compiling, but still takes 40% of the overall time to compile. |
Checking this with cargo-llvm-lines, a release build of edit: There's an open PR for serde_json that improves build times for me by over 50%. |
Good afternoon everyone.
I was looking for a simple way to load gltf files into my existing 3D application. I found this crate, and added a line to test it out:
let glb = Gltf::open("./data/models/BoomBox.glb").unwrap();
However, even adding this one line causes my build times to explode!
For this test, the application has already been built before, so we'll just be incrementally compiling main.rs.
Below are the incremental build timings measured using powershell's Measure-Command feature.
Without the new line of code:
With the new line of code:
Does anyone know what might be causing this huge increase? I assume that others are not simply living with these crazy build times.
Thank you.
The text was updated successfully, but these errors were encountered: