-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Investigate inconsistent performance of hashTreeRoot() #78
Comments
hashTreeRoot
Performance is inconsistent because we only re-hash new nodes in the tree since the last hashTreeRoot. In the case of your test, the balances, which is a large subtree, get replaced. So those subtrees need complete rehashing, and hashTreeRoot takes longer. |
in each for loop, I clone a new BeaconState to make it all equivalent so I think the cache is all the same (initially I did a so we need to investigate why sometimes it takes up to more than 500ms for |
this is due to our |
I've done some extra analysis of the performance of hashTreeRoot. Commenting to link the issues ChainSafe/lodestar#2206 The approach is to compare us with Lighthouse, and apparently our hashing function is a fast a theirs but for some reason our performance is still slower. Also, to explain why we spent so much time hashing the state in the epoch transitions, maybe they pre-compute more roots beforehand somehow? |
we switched to ssz v2 a long time ago #223 |
part of ChainSafe/lodestar#2046
this is a simple test to calculate
hashTreeRoot
this prints out
hashTreeRoot minTime: 65 maxTime: 507 average: 80.46129999999977 MAX_TRY: 10000
. I notice the max time is very similar to the one we have during a long epoch transition.we need to investigate why the performance is inconsistent and if we can improve it.
The text was updated successfully, but these errors were encountered: