Skip to content

avoid unnecessary hash lookups #663

@GrapeBaBa

Description

@GrapeBaBa

loop over 0..numValidators() (real network the number is big), doing a HashMap .get() for each. Most validators won't have a tracker entry, so most iterations are wasted hash lookups. Even those that do exist get an unnecessary .put() write-back

https://github.com/blockblaz/zeam/blob/main/pkgs/node/src/forkchoice.zig#L891-L895

https://github.com/blockblaz/zeam/blob/main/pkgs/node/src/forkchoice.zig#L987-L1004

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions