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

Adaptive Replacement Cache (ARC) #5116

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

devxadarsh
Copy link

@devxadarsh devxadarsh commented Apr 23, 2024

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized it.
  • All filenames are in PascalCase.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
  • All new code is formatted with clang-format -i --style=file path/to/your/file.java

@TruongNhanNguyen
Copy link
Contributor

Have you read the CONTRIBUTING.md correctly? It would help if you wrote parametrized tests in a separate file in the test directory. You can refer to current implementations in this repository to know how to write tests.

@codecov-commenter
Copy link

codecov-commenter commented Apr 23, 2024

Codecov Report

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

Project coverage is 38.24%. Comparing base (d3bb691) to head (04be243).

Files Patch % Lines
.../thealgorithms/datastructures/caches/ARCCache.java 62.00% 16 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5116      +/-   ##
============================================
+ Coverage     38.16%   38.24%   +0.07%     
- Complexity     2362     2370       +8     
============================================
  Files           517      518       +1     
  Lines         15350    15400      +50     
  Branches       2965     2971       +6     
============================================
+ Hits           5858     5889      +31     
- Misses         9205     9220      +15     
- Partials        287      291       +4     

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

@TruongNhanNguyen
Copy link
Contributor

Please ensure that tests are added to handle lines with partial coverage.

Copy link
Author

@devxadarsh devxadarsh left a comment

Choose a reason for hiding this comment

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

I reviewed and update the code

@TruongNhanNguyen
Copy link
Contributor

You should format the code. LGTM

devxadarsh and others added 11 commits April 28, 2024 18:25
It aims to provide better performance compared to traditional caching algorithms like LRU (Least Recently Used) and LFU (Least Frequently Used).
Main Method Removed for ARCCache.java
Test cases added for the ARC
Replaced private final p(Pivot) using
private final int t1Capacity;
private final int b1Capacity;
adjustCacheSize();
updated test case for t1capacity and b1 capacity
Copy link
Author

@devxadarsh devxadarsh left a comment

Choose a reason for hiding this comment

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

Updated comments

@TruongNhanNguyen
Copy link
Contributor

Please format your code using clang-format.

@devxadarsh devxadarsh requested a review from vil02 May 8, 2024 08:22
@vil02
Copy link
Member

vil02 commented May 9, 2024

Please add the missing tests and update your branch.

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

5 participants