-
Notifications
You must be signed in to change notification settings - Fork 7
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
Optimize get_peaks_and_heights for archival MMR. #141
Optimize get_peaks_and_heights for archival MMR. #141
Conversation
Thanks @zkclay for the PR. I like the comparative simplicity of this approach. lgtm, but i will defer to @Sword-Smith on this one. |
Let's get rid of This will probably also make your benchmark even faster :) |
@Sword-Smith I have gotten rid of the function completely and added the updated benchmark above. I think removing it completely was a good ideas, aside from the speedup, it's satisfying to delete even more code 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice :) Glad to see a 20 % speedup. LGTM.
Edit: We're intending to do the same for the ArchivalMutatorSet btw. In case you're looking for more stuff to do :)
Thanks, @Sword-Smith1 I will get to work on it! I assume that's the work covered by Issue #127 ? |
It is :) |
This PR is a response to Issue #125
I chose to keep the
get_peaks_and_heights_async
and place the new functionality inside it rather than inget_peaks
because the async function is used 5 or 6 times within the test suite. I ran the benchmarks before and after the change and obtained the following results:Master:
My PR:
In multiple runs I noticed the same small but consistent improvement on my machine, its possible that in setups with different tradeoffs between disk I/O and CPU speed, the difference would be more pronounced.
EDIT:
I definitely see even more gains after removing the
get_peaks_and_heights_async
function completely