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

Retain executor cache counts #22322

Merged
merged 3 commits into from Jan 6, 2022

Conversation

jackcmay
Copy link
Contributor

@jackcmay jackcmay commented Jan 6, 2022

Problem

When an executor cache entry is re-added its counts are cleared, wiping out its history even though it might be used frequently

Summary of Changes

Retain those counts

Fixes #

@jackcmay
Copy link
Contributor Author

jackcmay commented Jan 6, 2022

@t-nelson @jstarry This is already probably part of the eviction rework but in case not we should probably retain these counts on re-add

@jstarry
Copy link
Member

jstarry commented Jan 6, 2022

Looks like a good incremental improvement to me, just needs tests

t-nelson
t-nelson previously approved these changes Jan 6, 2022
Copy link
Contributor

@t-nelson t-nelson left a comment

Choose a reason for hiding this comment

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

lgtm! Just one suggestion for you to take or leave

if count < least {
least = count;
least_key = key;
let entry = if let Some(entry) = self.executors.get(pubkey) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If we remove() instead of get() here, the entry can be reused and avoid the atomic ops

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, much better, I also added a bit more cleanup possible due to your suggestion, thanks!

@mergify mergify bot dismissed t-nelson’s stale review January 6, 2022 06:09

Pull request has been modified.

@codecov
Copy link

codecov bot commented Jan 6, 2022

Codecov Report

Merging #22322 (7f345bd) into master (6c65734) will decrease coverage by 0.0%.
The diff coverage is 81.5%.

@@            Coverage Diff            @@
##           master   #22322     +/-   ##
=========================================
- Coverage    81.1%    81.1%   -0.1%     
=========================================
  Files         523      551     +28     
  Lines      146793   149606   +2813     
=========================================
+ Hits       119067   121334   +2267     
- Misses      27726    28272    +546     

@jackcmay jackcmay merged commit f1e2598 into solana-labs:master Jan 6, 2022
@jackcmay jackcmay deleted the retain-executor-cache-counts branch January 6, 2022 16:56
mergify bot pushed a commit that referenced this pull request Jan 6, 2022
(cherry picked from commit f1e2598)
mergify bot pushed a commit that referenced this pull request Jan 6, 2022
(cherry picked from commit f1e2598)
mergify bot added a commit that referenced this pull request Jan 6, 2022
(cherry picked from commit f1e2598)

Co-authored-by: Jack May <jack@solana.com>
mergify bot added a commit that referenced this pull request Jan 6, 2022
(cherry picked from commit f1e2598)

Co-authored-by: Jack May <jack@solana.com>
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.

None yet

3 participants