You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf: use vector instead of hash map for ProcessPendingInstantSendLocks
The 'pend' local variable in ProcessPendingInstantSendLocks was previously
using the same data structure as pendingInstantSendLocks (a hash map).
However, once we're in the processing step, we only iterate sequentially
through the locks - there are no hash-based lookups.
This commit changes 'pend' to use std::vector for better performance:
- Improved cache locality with contiguous memory layout
- Better CPU prefetching during iteration (3x through the data)
- Eliminates hash map overhead (bucket allocation, pointer chasing)
- Filtering step uses build-new-vector approach to maintain O(n)
The typical case processes up to 32 locks, making the vector's sequential
access pattern ideal for modern CPU cache hierarchies.
0 commit comments