-
Notifications
You must be signed in to change notification settings - Fork 57
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
hex::encode performance #18
Comments
But it looks like it is impossible to do better 🐶 |
Hi there! Just a few quick comments from my side. The non-linearity you see is probably caused by two things: constant measuring overhead and more importantly memory allocation. About improving performance: for larger inputs, you will be able to improve performance a whole lot by using SIMD instructions. A quick search brought up this crate: Also, related: #14 |
Hi, just sayin' that with last commit b86f391 I managed to double performance according to benchmarks actually implemented:
Compared to previous:
|
Hi,
My code heavily relies on
hex::encode
from your crate. I'm not sure that performance ofhex::encode
is a bottleneck in my project, but for some of my methods a single call tohex::encode
takes about 1/4 of overall time the method takes. It's too long for my crypto-related stuff, yethex
is a very nice crate.I started an investigation and added a
bench
forhex::encode
in my fork.What's interesting is the fact that the performance of
hex::encode
depends on a length of input non-lineary.Here is an output of
cargo bench
for information.What I'm going to do is to try to improve the performance of this method.
Please vote up / comment in a case my investigation and pull-requests are appreciated here.
Thanks!
The text was updated successfully, but these errors were encountered: