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

Find a better mp-int library to handle costly large integer calculation. #1584

Open
jangko opened this issue May 17, 2023 · 2 comments
Open

Comments

@jangko
Copy link
Contributor

jangko commented May 17, 2023

Running 9 modexp test of eth test suite, the result is:

geth: 840+ ms
nimbus + tommath: 4s. 760+ ms
nimbus + stint: 12s, 880+ ms

Find a better mp-int library that can handle arbitrary input length and have modpow/modexp optimization.
And not limited to modexp precompile only, maybe can be extended to other area where stint is slow.

@winsvega
Copy link

In my experience if you want smth optimised for your particular problem, the best is to do it yourself.

@mratsim
Copy link
Contributor

mratsim commented May 30, 2023

This implementation offers a 80x speedup over Stint on Uint256 modular exponentiation (and is generic to any runtime size):

mratsim/constantine#242 (comment)

bench 1

image

@jangko jangko added the hard label Aug 18, 2023
@jangko jangko added the EL label Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants