[Java Feature Server] Use hgetall in redis connector when number of retrieved fields is big enough - #2159
Conversation
Signed-off-by: pyalex <moskalenko.alexey@gmail.com>
Signed-off-by: pyalex <moskalenko.alexey@gmail.com>
Signed-off-by: pyalex <moskalenko.alexey@gmail.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2159 +/- ##
==========================================
- Coverage 84.40% 84.39% -0.01%
==========================================
Files 101 101
Lines 8098 8133 +35
==========================================
+ Hits 6835 6864 +29
- Misses 1263 1269 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: pyalex <moskalenko.alexey@gmail.com>
Signed-off-by: pyalex <moskalenko.alexey@gmail.com>
|
|
||
| // 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.
nit: maybe make this a constant at the beginning of the file so it's better visible?
tsotnet
left a comment
There was a problem hiding this comment.
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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: pyalex <moskalenko.alexey@gmail.com>
Signed-off-by: pyalex moskalenko.alexey@gmail.com
What this PR does / why we need it:
According to my analysis after the number of fields passed to
hmgetsurpasses some value (roughly 50) -hgetallbecomes a much more efficient way to retrieve the same data. With 250 fields -hgetallis 5x faster thenhmget.Which issue(s) this PR fixes:
Fixes #
Does this PR introduce a user-facing change?: