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

Introduce benching and improve add_blocks by 45% #101

Merged
merged 4 commits into from
Aug 22, 2024
Merged

Introduce benching and improve add_blocks by 45% #101

merged 4 commits into from
Aug 22, 2024

Conversation

RCasatta
Copy link
Collaborator

This introduce benching via criterion so that performance changes can be measured.

Criterion is used so that nightly is not required to run benchmarks and also has a nice change report.

The bench feature is introduced to expose to benching private functions, otherwise unreachable from the benches dir.

After setting up benchmark for the add_blocks 3 commits avoiding to recompute txids in various places gave a cumulative performance improvement of 45%

add_blocks              time:   [3.0339 ms 3.0457 ms 3.0579 ms]
                        change: [-45.830% -45.556% -45.277%] (p = 0.00 < 0.05)
                        Performance has improved.

Using criterion so that we don't need nightly to run benchmark.

The "bench" features is also introduced as a way to bench private
methods via public methods feature gated via this feature.
on my machine:

add_blocks              time:   [4.7562 ms 4.7754 ms 4.7972 ms]
                        change: [-15.059% -14.650% -14.169%] (p = 0.00 < 0.05)
                        Performance has improved.
add_blocks              time:   [3.9458 ms 3.9586 ms 3.9717 ms]
                        change: [-17.564% -17.103% -16.660%] (p = 0.00 < 0.05)
                        Performance has improved.
add_blocks              time:   [2.9788 ms 2.9938 ms 3.0101 ms]
                        change: [-24.810% -24.373% -23.897%] (p = 0.00 < 0.05)
                        Performance has improved.
@shesek
Copy link
Collaborator

shesek commented Aug 22, 2024

Woah very nice! Impressive gains for so little change. :)

@RCasatta RCasatta merged commit 987a66e into new-index Aug 22, 2024
4 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.

2 participants