Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Uses IntSet for RemoveUnrootedSlotsSynchronization::slots_under_contention #33530

Merged

Conversation

brooksprumo
Copy link
Contributor

@brooksprumo brooksprumo commented Oct 4, 2023

Problem

Accounts DB keeps a list of slots that is shared between flush and purge. This list is behind a mutex to ensure the two background processes don't interfere with each other. This list of slots is currently a HashSet, but we don't need strong cryptographic hashing on the slot; a simple vector would be fine too. We can use an IntSet to use the Slot directly, bypassing the need to perform an expensive hash.

Summary of Changes

Use IntSet for RemoveUnrootedSlotsSynchronization::slots_under_contention.

@brooksprumo brooksprumo self-assigned this Oct 4, 2023
@brooksprumo brooksprumo marked this pull request as ready for review October 4, 2023 20:03
Copy link
Contributor

@HaoranYi HaoranYi left a comment

Choose a reason for hiding this comment

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

lgtm

@codecov
Copy link

codecov bot commented Oct 4, 2023

Codecov Report

Merging #33530 (034de59) into master (f714a44) will decrease coverage by 0.1%.
Report is 2 commits behind head on master.
The diff coverage is 100.0%.

@@            Coverage Diff            @@
##           master   #33530     +/-   ##
=========================================
- Coverage    81.7%    81.7%   -0.1%     
=========================================
  Files         805      805             
  Lines      218111   218111             
=========================================
- Hits       178360   178351      -9     
- Misses      39751    39760      +9     

@brooksprumo brooksprumo merged commit c66af12 into solana-labs:master Oct 4, 2023
@brooksprumo brooksprumo deleted the nohash/slots-under-contention branch October 4, 2023 20:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants