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

Fix side effect of Remove operation. #2852

Closed
wants to merge 1 commit into from
Closed

Fix side effect of Remove operation. #2852

wants to merge 1 commit into from

Conversation

skypexu
Copy link
Member

@skypexu skypexu commented Oct 30, 2023

In the original ARC paper, there was no explanation of how Remove should be handled when the cache is full. The Remove operation would have a side effect on subsequent Put operations when the cache is not full, which is still evicting items even though it's clear that there is no need to evict when the cache is not full.

Now, code has been added to check if the cache is full to avoid performance degradation.

Also fix c_, it should be max_count.
Also add unittest.

What problem does this PR solve?

Issue Number:#2850
Problem Summary:

What is changed and how it works?

What's Changed:

How it Works:

Side effects(Breaking backward compatibility? Performance regression?):

Check List

  • Relevant documentation/comments is changed or added
  • I acknowledge that all my contributions will be made under the project's license

@wuhongsong
Copy link
Contributor

cicheck

@wuhongsong wuhongsong closed this Nov 2, 2023
@wuhongsong wuhongsong reopened this Nov 2, 2023
@wuhongsong
Copy link
Contributor

cicheck

@wuhongsong wuhongsong closed this Nov 2, 2023
@wuhongsong wuhongsong reopened this Nov 2, 2023
@wuhongsong
Copy link
Contributor

cicheck

11 similar comments
@YunhuiChen
Copy link
Contributor

cicheck

@skypexu
Copy link
Member Author

skypexu commented Nov 7, 2023

cicheck

@skypexu
Copy link
Member Author

skypexu commented Nov 7, 2023

cicheck

@skypexu
Copy link
Member Author

skypexu commented Nov 7, 2023

cicheck

@skypexu
Copy link
Member Author

skypexu commented Nov 7, 2023

cicheck

@skypexu
Copy link
Member Author

skypexu commented Nov 7, 2023

cicheck

@skypexu
Copy link
Member Author

skypexu commented Nov 7, 2023

cicheck

@skypexu
Copy link
Member Author

skypexu commented Nov 7, 2023

cicheck

@skypexu
Copy link
Member Author

skypexu commented Nov 8, 2023

cicheck

@skypexu
Copy link
Member Author

skypexu commented Nov 8, 2023

cicheck

@skypexu
Copy link
Member Author

skypexu commented Nov 9, 2023

cicheck

In the original ARC paper, there was no explanation of how Remove should be
handled when the cache is full. The Remove operation would have a side effect
on subsequent Put operations when the cache is not full, which is still
evicting items even though it's clear that there is no need to evict when
the cache is not full.

Now, code has been added to check if the cache is full to avoid performance
degradation.

Also fix c_, it should be max_count.
Also add unittest.

Signed-off-by: Xu Yifeng <bsddiy2@163.com>
@skypexu
Copy link
Member Author

skypexu commented Nov 9, 2023

cicheck

4 similar comments
@skypexu
Copy link
Member Author

skypexu commented Nov 9, 2023

cicheck

@skypexu
Copy link
Member Author

skypexu commented Nov 10, 2023

cicheck

@skypexu
Copy link
Member Author

skypexu commented Nov 13, 2023

cicheck

@skypexu
Copy link
Member Author

skypexu commented Nov 13, 2023

cicheck

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