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: [GH-910] Switch to use Redis UNLINK instead of DEL #921

Merged
merged 1 commit into from
Sep 17, 2023

Conversation

HishamAli81
Copy link
Contributor

In @keyv/redis, modified the delete() and clear() functions to use UNLINK instead of DEL to improve performance.

DEL is blocking and can take longer the larger the key size, whereas UNLINK is non-blocking and perform the operation in O(1) for each key removed regardless of its size.

Please check if the PR fulfills these requirements

  • Followed the Contributing guidelines.
  • Tests for the changes have been added (for bug fixes/features) with 100% code coverage.
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? feature

In @keyv/redis, modified the delete() and clear() functions to use UNLINK instead of DEL to improve performance.

DEL is blocking and can take longer the larger the key size, whereas UNLINK is non-blocking and perform the operation in O(1) for each key removed regardless of its size.
@codecov
Copy link

codecov bot commented Sep 17, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (103faa7) 100.00% compared to head (3090383) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #921   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines         2597      2597           
  Branches       343       343           
=========================================
  Hits          2597      2597           
Files Changed Coverage Δ
packages/redis/src/index.ts 100.00% <100.00%> (ø)

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

@jaredwray
Copy link
Owner

@HishamAli81 - Thanks so much and this has been included. It should go live in the next 2-3 weeks.

@jaredwray jaredwray merged commit fb3cf0d into jaredwray:main Sep 17, 2023
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.

3 participants