-
Notifications
You must be signed in to change notification settings - Fork 24.1k
improve performance for keys with expiration time #12177
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
Conversation
here benchmark result with duplicate 10 times, for command:
results:
|
the ci faied with message "Expected '29375' to be less than '29236' (context: type eval line 17 cmd {assert_lessthan $el_sum2 [expr $el_sum1+5000] } proc ::test)", It looks like same with #12169, @CharlesChen888 hi, could you have a look? thank you |
That is a new test for some new metrics in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think i'd rather just drop the assertion if it causes so much damage.
maybe it was needed during development time, but probably not needed anymore.
the complication of adding a server variable, and a debug command doesn't seem worth it.
please include some statement about the measured improvement in the top comment.
Totally agree. I just don't know why this assert was added so had to be conservative :-) |
This change only affects keys with expiry time.
For SETEX, the average improvement is 5%, and for GET with expiation key, we gain a improvement of 13%.
When keys have expiration time, Redis has an assertion to look up the main dict every time when it touches the expires.
This comes with a performance const, especially during rehash. the damage will be double.
It looks like that assert was added some ten years old, maybe out of paranoia, and there's probably no reason to keep it at that cost.