-
-
Notifications
You must be signed in to change notification settings - Fork 485
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
2x speed difference vs hand-unrolled #135
Comments
I see. If this is due to the lack of manual unrolling, this is very unfortunate. Perhaps we could somehow perform this unrolling automatically using macros. |
I've been using this, which you might also find useful:
This unrolls the closure into the "shape" of the matrix. |
Here's an example of matrix multiplication:
|
@yongqli What kind of compilation flags did you use for C and Rust? This forum thread's later posts touch upon the issue of |
When issues like this come up, I always feel like it should be pushed to the compiler, as this will solve it in more generally useful fashion (hopefully). |
The annotation for "fast" float semantics probably needs to be explicit. Maybe that's not the whole issue. |
Here's the rust issue on fast-math / imprecise float operations rust-lang/rust/issues/21690 |
There's still a performance difference of up to .8x to 2.3x with the latest version of
You can run it yourself by checking out https://github.com/yongqli/rust_linalgs_bench and running |
Hi,
Based on this blog post, I've decided to benchmark
nalgebra
and I've found it to be 2x slower. Any ideas why? I'm new to rust, so it's entirely possible I'm doing something wrong.https://gist.github.com/yongqli/7ba8ef0e06fbfaebd98f takes
9.186 s
to run, so9.18 ms
per 1 million iterations.takes
22 ms
according tocargo bench
.The text was updated successfully, but these errors were encountered: