-
Notifications
You must be signed in to change notification settings - Fork 653
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
Remove redundant dict_index calculations #1205
base: unstable
Are you sure you want to change the base?
Remove redundant dict_index calculations #1205
Conversation
Signed-off-by: Nadav Levanoni <[email protected]>
Signed-off-by: Nadav Levanoni <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## unstable #1205 +/- ##
============================================
+ Coverage 70.71% 70.72% +0.01%
============================================
Files 114 114
Lines 63090 63091 +1
============================================
+ Hits 44616 44624 +8
+ Misses 18474 18467 -7
|
Will add a follow-up PR for keys and scan commands. The impact will be greater because they do not cache the slot in the client. |
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.
lgtm
Signed-off-by: Nadav Levanoni <[email protected]>
I added the keysCommand optimization here. I had a cursory look at the scan command, and it might be trickier to find an optimization there. |
We need to start making use of the new
WithDictIndex
APIs which allow us to reuse the dict_index calculation (avoid over-callinggetKeySlot
for no good reason).In this PR I optimized
lookupKey
so it now callsgetKeySlot
to reuse the dict_index two additional times.The benefit here is reduced if the slot is cached in the client, which is generally the case.