Replies: 3 comments 6 replies
-
Beta Was this translation helpful? Give feedback.
-
|
Hi, thanks for the report. It has been a long time since I checked build times and yes, glam has got a lot more features since 2020, mostly all the integer vector types which while simple, are a lot of code. Do you have any glam features enabled? One thing I could do is make the integer types opt in, or opt out. Ultraviolet made f64 and int types opt in (I don't think they added all of the int types that glam has). It's something I could consider, I don't think I'd want to make it too fine grained because it would be a pain to maintain but wholesale disabling all int types wouldn't be too bad and would probably give 2020 compile times if you don't need integer types. I am kind of assuming it's the sheer amount of code in glam that is the problem, but if there's any way of getting more info out of cargo timings that might be useful. |
Beta Was this translation helpful? Give feedback.
-
|
I added a feature to turn off f64 which took my build time down from about 4s to 3.45s so that would suggest this is probably the way to go to claw back built times for things you don't use. It might take a while to get it all done and it will be a breaking change. |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
(it seems I can't create an issue that doesn't have either the 'enhancement or 'bug' labels so maybe this is the place)
I'm trying to shave as much off my cold compiles as possible and right now, glam seems to be the biggest offender with 2-2.5s compiles? Maybe this is expected, but I found your blogpost from 2020 in which the crate compiles in ~0.8s on a 4th gen i7 Intel CPU. I'm compiling on a Ryzen 7900 with 32GB DDR5-6000 and a much faster SSD than the HDD in the blog, so I'm wondering if this is known and if something can be done about this on glam's side? (There is this article for end-user compilation-time improvements but a library can't do most of those)
I understand of course that the library has since accumulated a lot of new features, so maybe there really is nothing you can do, but might as well ask since nobody else has seemingly asked yet. Incrementals do seem okay fortunately.
Here is the result of
cargo +nightly -Zsection-timings build --timingswith dev opt-level=1, no other factors (also tested in a completely fresh empty project with only glam and it takes a similar amount of time):cargo-timing-20260328T183602371Z-d93538c4ebb389a7.html
Edit: attached image for convenience

Beta Was this translation helpful? Give feedback.
All reactions