-
Notifications
You must be signed in to change notification settings - Fork 155
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
Matrix3 multiplication is 4x slower in 0.18 #543
Comments
Wow that's quite concerning! Thank you for bringing this up. |
comparing the benchmarks provided by the crate shows a similar (3x) increase:
There was no significant increase for any of the other benchmarks regarding |
It seems the problem is already fixed on the master branch, getting 4ns results there. |
Found the issue: Lines 311 to 337 in 637c566
This is on |
Great, thank you for investigation! |
AMD Ryzen 7 3700X
Windows 10 19044.1566
rustc 1.60.0-nightly (1e12aef3f 2022-02-13)
The other day I was testing sprite performance in my engine and noticed it was a lot lower than usual. Investigated the cause and found it was when I updated cgmath from 0.17 to 0.18.
With 0.17, my benchmark that does 100k translations, rotations, and scales on a Matrix3:
test bench_transform_matrix ... bench: 670,110 ns/iter (+/- 13,076)
With 0.18:
test bench_transform_matrix ... bench: 2,755,590 ns/iter (+/- 10,904)
The bench itself
Code for the transform wrapper
Since the transform happens for each sprite, the performance difference adds up quickly.
Using default features with -O2/-O3. Compiler target is
x86_64-pc-windows-msvc
.The text was updated successfully, but these errors were encountered: