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

Signature verification is very slow. #37

Open
dvush opened this issue Apr 16, 2020 · 2 comments
Open

Signature verification is very slow. #37

dvush opened this issue Apr 16, 2020 · 2 comments

Comments

@dvush
Copy link

dvush commented Apr 16, 2020

Hi @tomusdrw !

I used this library for eth signature verification.

The main issue that I have with it is that it is very slow. recover is around 3ms, but using rust bindings to native library (that you use under the hood) recover is around 66us. I found reason for this is that you create secp256k1::Secp256k1::verification_only() for every signature verification, this function by itself costs around 2.7 ms so it sums up.

Consider adding benchmarks, also I would suggest using thread_local to store secp256k1::Secp256k1::verification_only() objects.

Sincerely, Vitaly.

@tomusdrw
Copy link
Owner

tomusdrw commented Apr 16, 2020

Hi @dvush!
For now it was a concious decision to not focus on performance, thanks for the input, we already have a similar issue here: #14.
I'm definitely up for introducing benchmarks and lazy_static or thread_local to alleviate low performance. PRs welcome!

@dvush
Copy link
Author

dvush commented Apr 16, 2020

Thanks for response, I'll try to create PR with benchmarks at least, since I already done them in our project.

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

2 participants