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

Add benchmarks to compare different structures #415

Merged
merged 1 commit into from
Aug 20, 2021

Conversation

c410-f3r
Copy link
Contributor

@c410-f3r c410-f3r commented Aug 14, 2021

Useful to see how rust-decimal is performing compared to other libraries or how much is lagging behind f32 or f64 hardware based operations.

addition
division
subtration
multiplication

As seen from above, rust-decimal is the fastest decimal library with operations ~2000% slower if compared to native primitives.

@paupino
Copy link
Owner

paupino commented Aug 20, 2021

This is cool to see. Also cool to see that criterion and cargo-bench can exist together just fine.

@paupino paupino merged commit b3e5eeb into paupino:master Aug 20, 2021
@c410-f3r
Copy link
Contributor Author

Hum... I was thinking about removing comparisons between other rust libraries to prevent ppl pointing fingers and reduce the amount of development dependencies. So the only thing that would remain is the comparison between rust-decimal and native floating primitives

@paupino
Copy link
Owner

paupino commented Aug 20, 2021

Oh yeah - fair call. Perhaps a separate repo could compare all libraries instead - it is quite useful to keep track of over time but perhaps not the responsibility of this library/repo.

@c410-f3r
Copy link
Contributor Author

Oh yeah - fair call. Perhaps a separate repo could compare all libraries instead - it is quite useful to keep track of over time but perhaps not the responsibility of this library/repo.

Indeed! Another repository would be the best approach so feel free to create one if desired

paupino added a commit that referenced this pull request Aug 20, 2021
This reverts commit b3e5eeb, reversing
changes made to 3c0f76b.
@paupino
Copy link
Owner

paupino commented Aug 20, 2021

I reverted this PR but more than happy to include again for just f32/f64! One additional thought actually - I wonder if we need to do different numbers for a and b. I'm curious whether other libraries try to optimize on this scenario - much like Rust Decimal does (e.g. same scale, 32 bit divisor)!

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

Successfully merging this pull request may close these issues.

2 participants