Skip to content

Conversation

vadorovsky
Copy link
Member

@vadorovsky vadorovsky commented Oct 13, 2025

Problem

Building them with itertools::into_group_map takes 20.9ms.

before

Summary of Changes

Building them manually with a pre-allocated hash map, using pubkey hasher, takes 5.2ms.

after

Ref: #8280

@vadorovsky vadorovsky force-pushed the compute-epoch-schedule-group-map branch 2 times, most recently from e42e215 to cb8fedb Compare October 13, 2025 15:14
@codecov-commenter
Copy link

codecov-commenter commented Oct 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.2%. Comparing base (d3247fa) to head (b758fe5).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8451   +/-   ##
=======================================
  Coverage    83.2%    83.2%           
=======================================
  Files         841      841           
  Lines      368425   368438   +13     
=======================================
+ Hits       306635   306687   +52     
+ Misses      61790    61751   -39     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vadorovsky vadorovsky force-pushed the compute-epoch-schedule-group-map branch from cb8fedb to 37b32a9 Compare October 13, 2025 19:26
Building them with `itertools::into_group_map` takes 20.9ms.

Building them manually with a pre-allocated hash map, using pubkey
hasher, takes 5.2ms.
@vadorovsky vadorovsky force-pushed the compute-epoch-schedule-group-map branch from 37b32a9 to b758fe5 Compare October 14, 2025 07:07
@vadorovsky vadorovsky marked this pull request as ready for review October 14, 2025 07:24
slot_leaders: Vec<Pubkey>,
// Inverted index from pubkeys to indices where they are the leader.
leader_slots_map: HashMap<Pubkey, Arc<Vec<usize>>>,
leader_slots_map: HashMap<Pubkey, Vec<usize>, PubkeyHasherBuilder>,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

We might need to change this fn to not cloning the vec anymore since it is no longer an Arc.

@HaoranYi
Copy link

Excellent work! I have just one comment!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants