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 eviction alg hit ratio bench #299

Merged
merged 4 commits into from
Mar 31, 2024
Merged

Conversation

xiaguan
Copy link
Contributor

@xiaguan xiaguan commented Mar 27, 2024

What's changed and what's your intention?

insipred by https://github.com/cloudflare/pingora/blob/main/tinyufo/benches/bench_hit_ratio.rs

In order to implement new eviction algorithms later, such as s3fifo, we need an intuitive test to demonstrate how these algorithms work.

I also plan to test their performance under real trace datasets later (Tencent Photo Cache, Twitter Cache Trace). Should I include CSV files of around 200KB in the repository?

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)

Copy link
Owner

@MrCroxx MrCroxx left a comment

Choose a reason for hiding this comment

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

Rest LGTM. Thanks for your efforts. Please resolve the comments. Any question or discussion is welcomed. 🥰

foyer-memory/Cargo.toml Outdated Show resolved Hide resolved
foyer-intrusive/src/lib.rs Show resolved Hide resolved
foyer-memory/benches/bench_hit_ratio.rs Outdated Show resolved Hide resolved
foyer-memory/src/lib.rs Outdated Show resolved Hide resolved
foyer-memory/src/prelude.rs Outdated Show resolved Hide resolved
foyer-storage/src/lib.rs Show resolved Hide resolved
foyer-memory/benches/bench_hit_ratio.rs Outdated Show resolved Hide resolved
@MrCroxx
Copy link
Owner

MrCroxx commented Mar 29, 2024

BTW, I've approved the Github Action. You can run CI and check the results now.

The enum cache is more easy to use since it only has two generic parameters. The generic cache is more like an internal interface.

Signed-off-by: xiaguan <751080330@qq.com>
Copy link
Owner

@MrCroxx MrCroxx left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for your effort.

Signed-off-by: xiaguan <751080330@qq.com>
@xiaguan
Copy link
Contributor Author

xiaguan commented Mar 31, 2024

All test fixed.

@MrCroxx
Copy link
Owner

MrCroxx commented Mar 31, 2024

Hi, you can run make fast to run test locally first.

@MrCroxx
Copy link
Owner

MrCroxx commented Mar 31, 2024

And if hakari check failed on CI, just remove the local Cargo.lock file and run make fast locally again.

Signed-off-by: xiaguan <751080330@qq.com>
@xiaguan
Copy link
Contributor Author

xiaguan commented Mar 31, 2024

Hi, you can run make fast to run test locally first.

Thanks , it works.
I think wee need a dev_guide.md ?

@MrCroxx
Copy link
Owner

MrCroxx commented Mar 31, 2024

Hi, you can run make fast to run test locally first.

Thanks , it works. I think wee need a dev_guide.md ?

Agreed. Currently PR message covers some instructions except the hakari part.

Copy link

codecov bot commented Mar 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.10%. Comparing base (524b645) to head (55970f1).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #299      +/-   ##
==========================================
- Coverage   77.11%   77.10%   -0.02%     
==========================================
  Files          61       61              
  Lines        7478     7478              
==========================================
- Hits         5767     5766       -1     
- Misses       1711     1712       +1     

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

@MrCroxx MrCroxx merged commit e76a499 into MrCroxx:main Mar 31, 2024
12 checks passed
@xiaguan xiaguan deleted the bench_memory branch March 31, 2024 07:16
MrCroxx pushed a commit that referenced this pull request Apr 17, 2024
* feat: add eviction alg hit ratio bench

* refactor: use enum cache instead of generic cache

The enum cache is more easy to use since it only has two generic parameters. The generic cache is more like an internal interface.

Signed-off-by: xiaguan <751080330@qq.com>

* chore : sort foyer_memory's dependencies

Signed-off-by: xiaguan <751080330@qq.com>

* chore: use hakari to gen better dependencies

Signed-off-by: xiaguan <751080330@qq.com>

---------

Signed-off-by: xiaguan <751080330@qq.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

2 participants