-
-
Notifications
You must be signed in to change notification settings - Fork 22
fix: optimize the leaf node creation #499
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
base: master
Are you sure you want to change the base?
Conversation
* fix: optimise duplicate writing in leafnode creation * chore: apply same temp array rewriting in packedUintNum64sToLeafNodes * chore: only anntend to specific dev comment before feedback
Performance Report✔️ no performance regression detected Full benchmark results
|
// Precompute final h values once | ||
const hValues = [0, 0, 0, 0, 0, 0, 0, 0]; | ||
|
||
// Whole 4-byte words we can take directly |
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.
i see here, that the real only thing of note that you only change from my implemtation is
const hValues = new Array(8).fill(0);
// to
hValues = [0, 0, 0, 0, 0, 0, 0, 0];
is there any computation benfit against using Array.fill
here?
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.
likely doesn't matter, but using a literal may be faster.
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.
would be great to know how does this PR impacts the performance through benchmarks
Motivation
Improve the performance of lead node creation during the packing values.
Description
LeafNode
objectLeftNode
object once with those values.Based on the work started in this PR #493
Steps to test or reproduce
Run all tests.