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

Avoid allocation in sector roots #52

Merged
merged 2 commits into from
Sep 26, 2024
Merged

Conversation

ChrisSchinnerl
Copy link
Member

I noticed that the inline type hints showed a Vec as an intermediary result. Apparently chunks requires a vector to pass on the references of step_by.
This PR fixes that to avoid that allocation and uses the recommended par_chunks_exact_mut instead of chunks.

     Running benches/merkle_root.rs (target/release/deps/merkle_root-9e0ec57c6e502a76)
Gnuplot not found, using plotters backend
sector_root             time:   [2.9715 ms 2.9886 ms 3.0070 ms]
                        change: [-8.0434% -6.9685% -6.0062%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
  3 (3.00%) high mild

@n8maninger n8maninger merged commit f659654 into master Sep 26, 2024
1 check passed
@n8maninger n8maninger deleted the chris/sector-roots-speedup branch September 26, 2024 15:30
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