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

feat: add ghost queue for s3fifo, fix panic #400

Merged
merged 1 commit into from
Apr 22, 2024
Merged

feat: add ghost queue for s3fifo, fix panic #400

merged 1 commit into from
Apr 22, 2024

Conversation

MrCroxx
Copy link
Collaborator

@MrCroxx MrCroxx commented Apr 22, 2024

What's changed and what's your intention?

Please explain IN DETAIL what the changes are in this PR and why they are needed. :D

Wired. With zipf distribution, s3fifo without ghost queue works much better than that with a ghost queue. 🤔

cargo bench --bench bench_hit_ratio

zif_exp, cache_size           fifo            lru             lfu             s3fifo (0g)     s3fifo (10g)    moka
  0.90,  0.005                16.22%          19.19%          32.34%          32.60%          20.92%          33.37%
  0.90,   0.01                22.55%          26.22%          38.54%          39.01%          27.99%          37.86%
  0.90,   0.05                41.10%          45.60%          55.45%          56.65%          47.43%          55.23%
  0.90,    0.1                51.09%          55.72%          63.84%          65.10%          57.58%          64.21%
  0.90,   0.25                66.81%          71.19%          76.21%          77.55%          73.29%          77.11%
  1.00,  0.005                26.62%          31.08%          44.19%          44.29%          33.11%          45.66%
  1.00,   0.01                34.39%          39.17%          50.65%          51.24%          41.03%          50.73%
  1.00,   0.05                54.03%          58.75%          66.77%          67.89%          60.54%          66.95%
  1.00,    0.1                63.12%          67.58%          73.90%          74.96%          69.30%          74.36%
  1.00,   0.25                76.17%          79.94%          83.62%          84.50%          81.46%          84.30%
  1.05,  0.005                32.66%          37.70%          50.24%          50.14%          39.77%          51.85%
  1.05,   0.01                40.96%          46.09%          56.74%          57.45%          48.13%          57.08%
  1.05,   0.05                60.48%          65.09%          72.08%          73.16%          66.79%          72.39%
  1.05,    0.1                68.93%          73.11%          78.48%          79.40%          74.70%          78.93%
  1.05,   0.25                80.38%          83.76%          86.80%          87.50%          85.04%          87.43%
  1.10,  0.005                38.98%          44.46%          56.23%          56.56%          46.54%          57.86%
  1.10,   0.01                47.62%          52.95%          62.62%          63.38%          54.95%          63.18%
  1.10,   0.05                66.58%          70.94%          76.92%          77.86%          72.50%          77.24%
  1.10,    0.1                74.28%          78.09%          82.57%          83.34%          79.40%          83.04%
  1.10,   0.25                84.18%          87.09%          89.57%          90.07%          88.16%          90.11%
  1.50,  0.005                81.15%          85.24%          88.87%          89.27%          85.99%          89.88%
  1.50,   0.01                86.91%          89.87%          92.25%          92.65%          90.40%          92.79%
  1.50,   0.05                94.77%          96.05%          96.96%          97.07%          96.29%          97.08%
  1.50,    0.1                96.66%          97.51%          98.07%          98.09%          97.68%          98.16%
  1.50,   0.25                98.36%          98.81%          99.04%          99.02%          98.91%          99.10%

Checklist

  • I have written the necessary rustdoc comments
  • I have added the necessary unit tests and integration tests
  • I have passed make all (or make fast instead if the old tests are not modified) in my local environment.

Related issues or PRs (optional)

close #360

Signed-off-by: MrCroxx <mrcroxx@outlook.com>
@MrCroxx MrCroxx added bug Something isn't working feature New feature or request refactor labels Apr 22, 2024
@MrCroxx MrCroxx enabled auto-merge (squash) April 22, 2024 18:34
Copy link

codecov bot commented Apr 22, 2024

Codecov Report

Attention: Patch coverage is 81.81818% with 16 lines in your changes are missing coverage. Please review.

Project coverage is 80.67%. Comparing base (7e888cc) to head (399551a).

Files Patch % Lines
foyer-memory/src/eviction/s3fifo.rs 81.39% 16 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #400      +/-   ##
==========================================
- Coverage   80.68%   80.67%   -0.02%     
==========================================
  Files          52       52              
  Lines        6923     6979      +56     
==========================================
+ Hits         5586     5630      +44     
- Misses       1337     1349      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MrCroxx MrCroxx merged commit aa8f817 into main Apr 22, 2024
13 checks passed
@MrCroxx MrCroxx deleted the xx/gs3fifo branch April 22, 2024 18:38
@MrCroxx MrCroxx mentioned this pull request Apr 23, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature New feature or request refactor
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

bug: S3FIFO wrongly return empty when evict
1 participant