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

perf(precompile): use secp256k1 global context for ecrecover #1843

Merged

Conversation

Rjected
Copy link
Collaborator

@Rjected Rjected commented Nov 1, 2024

Initializing a new Secp256k1 instance ever ecrecover call ends up dominating execution time, because of the randomization. This now uses the global context, avoiding randomization overhead.

Samply profiles from https://share.firefox.dev/4hwBrXj
Screenshot 2024-11-01 at 4 19 08 PM
Screenshot 2024-11-01 at 4 19 39 PM
Screenshot 2024-11-01 at 4 21 40 PM

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should also send this to release/v50

because this is the branch that's being released

Copy link
Collaborator

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch

Copy link
Member

@rakita rakita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, test failing not related.

@rakita rakita merged commit bbc8d81 into bluealloy:main Nov 4, 2024
23 of 27 checks passed
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.

5 participants