-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[Java Feature Server] Use hgetall in redis connector when number of retrieved fields is big enough #2159
Conversation
Signed-off-by: pyalex <[email protected]>
Signed-off-by: pyalex <[email protected]>
Signed-off-by: pyalex <[email protected]>
Signed-off-by: pyalex <[email protected]>
Signed-off-by: pyalex <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #2159 +/- ##
===========================================
- Coverage 84.40% 58.75% -25.66%
===========================================
Files 101 101
Lines 8098 8107 +9
===========================================
- Hits 6835 4763 -2072
- Misses 1263 3344 +2081
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Signed-off-by: pyalex <[email protected]>
Signed-off-by: pyalex <[email protected]>
|
||
// Number of fields that controls whether to use hmget or hgetall was discovered empirically | ||
// Could be potentially tuned further | ||
if (retrieveFields.size() < 50) { |
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.
nit: maybe make this a constant at the beginning of the file so it's better visible?
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.
Added constant
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.
Looks good to me overall
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pyalex, tsotnet The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: pyalex <[email protected]>
Signed-off-by: pyalex [email protected]
What this PR does / why we need it:
According to my analysis after the number of fields passed to
hmget
surpasses some value (roughly 50) -hgetall
becomes a much more efficient way to retrieve the same data. With 250 fields -hgetall
is 5x faster thenhmget
.Which issue(s) this PR fixes:
Fixes #
Does this PR introduce a user-facing change?: