Skip to content
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

How is the performance compared to the C version? #110

Open
gkorland opened this issue Mar 29, 2022 · 4 comments
Open

How is the performance compared to the C version? #110

gkorland opened this issue Mar 29, 2022 · 4 comments

Comments

@gkorland
Copy link

How is Rust version performance compared to the C version?

@jonhoo
Copy link
Collaborator

jonhoo commented Apr 2, 2022

We do have a number of benchmarks (run with cargo +nightly bench), but I don't know that any of them are 1:1 with any known C benchmarks. Even things like measuring the performance of record is difficult because it depends on how you generate the samples, what precision you record with, what computer you're running on, etc. @marshallpierce probably has the most insight into this.

Do you have concrete benchmarks you'd like to see comparisons of? In general, I'd expect the Rust version to be very close in performance to the C version.

@jonhoo
Copy link
Collaborator

jonhoo commented Apr 2, 2022

Very generically though, on my laptop, recording a random value on average takes about 5.6ns.

@marshallpierce
Copy link
Collaborator

Concur w/ all of the above. I would expect it to be comparable, and if you find instances where it is not, that would be great to know. The hot paths inherit all the optimization that went into the Java version, so they boil down to patterns like loading a very-likely-cache-resident field, mask, shift, write. There's not a whole lot left to wring out of that sort of logic without SIMD, which isn't applicable here since we get one datum at a time, so we just hope that the LLVM gods smile upon us.

@jonhoo
Copy link
Collaborator

jonhoo commented Apr 2, 2022

We are probably missing some optimizations that have landed since the port for less-hot paths like #109, but that's the only one I know about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants