Skip to content
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

implements random eviction for read-only accounts cache #32721

Closed

Conversation

behzadnouri
Copy link
Contributor

Problem

Summary of Changes

Fixes #

@codecov
Copy link

codecov bot commented Aug 6, 2023

Codecov Report

Merging #32721 (a928e02) into master (6eea38d) will decrease coverage by 0.1%.
Report is 5 commits behind head on master.
The diff coverage is 98.9%.

@@            Coverage Diff            @@
##           master   #32721     +/-   ##
=========================================
- Coverage    82.0%    81.9%   -0.1%     
=========================================
  Files         785      785             
  Lines      211192   211177     -15     
=========================================
- Hits       173200   173089    -111     
- Misses      37992    38088     +96     

@behzadnouri
Copy link
Contributor Author

@jeffwashington this is an alternative approach using random evictions: https://danluu.com/2choices-eviction/

The upside is that loads only need atomic updates, so no write-locks in load function.
On the other hand, the algorithm is probabilistic in nature and stores need to do more work.

I have arbitrarily picked

const PRUNE_RANDOM_SAMPLE_SIZE: usize = 8;

but that could possibly be optimized based on performance tests on mainnet.

@github-actions github-actions bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Aug 22, 2023
@github-actions github-actions bot closed this Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale [bot only] Added to stale content; results in auto-close after a week.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant