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

Reuse stint primitives for limbs #10

Merged
merged 6 commits into from
Aug 8, 2024
Merged

Reuse stint primitives for limbs #10

merged 6 commits into from
Aug 8, 2024

Conversation

arnetheduck
Copy link
Member

This PR makes bncurve less slow by reusing stint integer primtivies and unrolling a few loops and arrays to avoid array length checks and the like.

To give an idea, it brings down processing 8k nimbus-eth1 blocks around the 18M block height mark from 24 to 16 minutes - this is quite significant given that a lot of time in eth1 is spent reading the database - this is at least an order of magnitude of bncurve improvement but probably quite a lot more - how much doesn't greatly matter but now there's at least a decent baseline for any future performance work ;)

Of course, reusing private primitives from stint is not pretty - the plan is to extract them to a separate library, work started in status-im/nim-stew#187.

This PR makes bncurve less slow by reusing stint integer primtivies and
unrolling a few loops and arrays to avoid array length checks and the
like.

To give an idea, it brings down processing 8k nimbus-eth1 blocks around
the 18M block height mark from 24 to 16 minutes - this is quite
significant given that a lot of time in eth1 is spent reading the
database - this is at least an order of magnitude of bncurve improvement
but probably quite a lot more - how much doesn't greatly matter but now
there's at least a decent baseline for any future performance work ;)

Of course, reusing private primitives from `stint` is not pretty - the
plan is to extract them to a separate library, work started in
status-im/nim-stew#187.
@arnetheduck arnetheduck merged commit b88ed93 into master Aug 8, 2024
10 checks passed
@arnetheduck arnetheduck deleted the primitives branch August 8, 2024 20:22
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.

1 participant