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: make lossy buffers dynamically striped #106

Merged
merged 2 commits into from
Sep 16, 2024
Merged

Conversation

maypok86
Copy link
Owner

@maypok86 maypok86 commented Sep 15, 2024

Description

I ported lossy buffers from caffeine and tried to cover them with tests as much as possible.

Advantages:

  • Memory consumption is minimized for caches that are not heavily contended on.
  • The hit rate has been slightly increased.

Disadvantages:

  • Much more complex code :)

Related issue(s)

#74

✅ Checklist for your Pull Request

Related changes (conditional)

  • Tests

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from
      silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
  • Public contracts

    • My changes doesn't break project license.

Stylistic guide (mandatory)

  • My code complies with the styles guide.

  • My commit history is clean (only contains changes relating to my
    issue/pull request and no reverted-my-earlier-commit changes) and commit
    messages start with identifiers of related issues in square brackets.

    Example: [#42] Short commit description

    If necessary both of these can be achieved even after the commits have been
    made/pushed using rebase and squash.

Before merging (mandatory)

  • Check target branch of PR is set correctly

@maypok86
Copy link
Owner Author

There are quite a few minor linter edits due to the golangci-lint update, but I'm too tired to try to separate them.

@codecov-commenter
Copy link

codecov-commenter commented Sep 15, 2024

Codecov Report

Attention: Patch coverage is 95.07042% with 7 lines in your changes missing coverage. Please review.

Project coverage is 94.15%. Comparing base (0e7b832) to head (6553764).
Report is 46 commits behind head on v2.

Files with missing lines Patch % Lines
internal/lossy/striped.go 93.61% 3 Missing and 3 partials ⚠️
internal/eviction/disabled.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##               v2     #106      +/-   ##
==========================================
- Coverage   94.27%   94.15%   -0.12%     
==========================================
  Files          29       30       +1     
  Lines        1345     1421      +76     
==========================================
+ Hits         1268     1338      +70     
- Misses         55       58       +3     
- Partials       22       25       +3     

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

@maypok86 maypok86 merged commit 33e2a3c into v2 Sep 16, 2024
6 checks passed
@maypok86 maypok86 deleted the growable-read-buffers branch September 16, 2024 16:53
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.

2 participants