-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
Benchmark array-ish structures #2926
Conversation
Code Climate has analyzed commit 6aacd2f and detected 0 issues on this pull request. View more on Code Climate. |
Performance Report✔️ no performance regression detected Full benchmark results
|
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.
Thanks for having this statistic 👍 , as we'll have more and more validators especially after the Merge, I suppose the loop speed is more and more important and we want to take a scalable approach.
To deduplicate validator data, I suggest keeping only validator roots in the tree (i.e. validatorRoots: new ListType({elementType: Root, limit: VALIDATOR_REGISTRY_LIMIT})
and still keep CachedValidatorList
to get the best of both world: the hash
, the loop
and access validator properties. I'm not sure how serialize()
works for CachedBeaconState
through.
What do you think @wemeetagain @dapplion ?
Definitely agree. I think the only question is how we should go about that. You mentioned the tradeoff of storing the deserialized validators separately. Done naively, it breaks ssz serialization/deserialization (and proof generation). Another approach may be to work within the ssz library to support hybrid tree-backed / struct-backed values. This could make it easier to maintain compatibility with the full range of ssz operations. The tradeoff being that it may be harder to customize / get the exact performance characteristics we're wanting in lodestar. |
Motivation
To properly optimize our beacon state transition performance and memory usage we need to understand the tradeoffs or our different approaches.
Description
Add informational tests (not run in CI) with hardcoded results.
Notable results: