improve performance for keys with expiration time#12177
improve performance for keys with expiration time#12177oranagra merged 1 commit intoredis:unstablefrom
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.
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.