-
Notifications
You must be signed in to change notification settings - Fork 51
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
Feature/htr #8
Feature/htr #8
Conversation
Please add a HashTreeRoot interface so we can do checks like this: if v, ok := object.(ssz.HashTreeRooter); ok {
return v.HashTreeRoot()
} Edit: nevermind, i see you already did that. Thanks! |
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 it be possible to change the return type to |
Sure, no problem |
Here's some benchmarks I ran to compare this against go-ssz.HashTreeRoot. Please don't interpret the execution time to be how long HTR takes, this benchmark was reading files from disk, unmarshalling, marshalling, and some byte comparisions against spec tests. |
The 'htr_off' benchmarks are done with go-ssz or with the custom functions in prysm? I am not getting the same results on my benchmarks. I used this Htr benchmark for both fastssz and go-ssz and got:
where 'BenchmarkHashTreeRootGoSSZ' is
The numbers seem accurate for fastssz. The implementation reuses all the memory and the main factor that accounts for most of the time consumed is the sha hashing. |
They are done with go-ssz, except for the BeaconState which uses its custom HTR function. As I mentioned before, don't interpret these times as HTR only, it does a lot more than only HTR. Here's the benchmark on a working branch: https://github.com/prysmaticlabs/prysm/blob/d89a4af4637b5fe00e3ad242d55f70ba8de3be39/proto/testing/ssz_static_mainnet_test.go#L11 |
Use `MerkleizeVectorizedHTR` inside `HashTreeRootWith`
This PR includes support for two things: