Optimize SET key value EX/PX/EXAT ttl to reduce calls of rewriteClientCommandVector#3279
Conversation
…tCommandVector If the command is in the form of "SET key value EX/PX/EXAT ttl", then we don't need to rewrite the entire command vector. In addition to saving the rewriting of the command vector, we also save one command table lookup in this case ince we don't need to lookup SET command again. Like 2544755. Signed-off-by: Binbin <binloveplay1314@qq.com>
|
In 53d1acd we decided to always replica in absolute timestamps. I don't remember the context, but guess matters when the replication is lagging and in AOF files. |
This PR did not change it, we still rewrite it as absolute timestamps. (And btw, we have a lot of abs-ttl test around it in expire.tcl, so we did not change anything) The different is: Before this PR, a And in this PR, a If a command is rewriteClientCommandVector rewrite the whole argv:
And in this PR, we only rewrite those args that need rewriting: |
zuiderkwast
left a comment
There was a problem hiding this comment.
we still rewrite it as absolute timestamps
Sorry, I didn't read the code properly. Looks good!
sarthakaggarwal97
left a comment
There was a problem hiding this comment.
LGTM! @enjoy-binbin would it make sense to add a test that verifies this argc == 5 path?
we already had a lot of it |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #3279 +/- ##
================================
================================
🚀 New features to boost your workflow:
|
…tCommandVector (#3279) If the command is in the form of "SET key value EX/PX/EXAT ttl", then we don't need to rewrite the entire command vector. In addition to saving the rewriting of the command vector, we also save one command table lookup in this case ince we don't need to lookup SET command again. We already have many relevant test coverages in expire.tcl. This PR does not change anything around the propagate. Somehow like 2544755. Signed-off-by: Binbin <binloveplay1314@qq.com>
If the command is in the form of "SET key value EX/PX/EXAT ttl",
then we don't need to rewrite the entire command vector.
In addition to saving the rewriting of the command vector, we also
save one command table lookup in this case ince we don't need to
lookup SET command again.
We already have many relevant test coverages in expire.tcl. This
PR does not change anything around the propagate.
Like 2544755.