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

[BUG](common): ARCCache's param c means cache capacity #2952

Closed
zztaki opened this issue Dec 8, 2023 · 5 comments
Closed

[BUG](common): ARCCache's param c means cache capacity #2952

zztaki opened this issue Dec 8, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@zztaki
Copy link
Contributor

zztaki commented Dec 8, 2023

Describe the bug (描述bug)
ARCCache's param c means cache capacity, but in the code, it is not. So this will cause ARCCache's real capacity will be maxCount/2.

To Reproduce (复现方法)

Expected behavior (期望行为)

Versions (各种版本)
OS:
Compiler:
branch:
commit id:

Additional context/screenshots (更多上下文/截图)

@zztaki zztaki added the bug Something isn't working label Dec 8, 2023
@zztaki
Copy link
Contributor Author

zztaki commented Dec 8, 2023

If you think this makes sense, I am glad to submit a PR and add some tests for ARCCache :)

@zztaki
Copy link
Contributor Author

zztaki commented Dec 8, 2023

image

@zztaki
Copy link
Contributor Author

zztaki commented Dec 8, 2023

Maybe you consider BList overhead. But in fact, BList doesn't store Value and only stores some indexes, which represent some recently visited objects that may be frequent. :)

struct BListVal {
bmap_iter map_iter;

@wuhongsong
Copy link
Contributor

#2852 @zztaki this pr will be ok.may reopen it later.

@skypexu
Copy link
Member

skypexu commented Dec 14, 2023

#2962

@zztaki zztaki closed this as completed Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants