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
Optimize ZRANGE replies WITHSCORES in case of integer scores #11779
Merged
oranagra
merged 7 commits into
redis:unstable
from
filipecosta90:zrange.withscores.d2string
Feb 6, 2023
Merged
Optimize ZRANGE replies WITHSCORES in case of integer scores #11779
oranagra
merged 7 commits into
redis:unstable
from
filipecosta90:zrange.withscores.d2string
Feb 6, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filipecosta90
added
the
action:run-benchmark
Triggers the benchmark suite for this Pull Request
label
Feb 3, 2023
oranagra
reviewed
Feb 3, 2023
oranagra
reviewed
Feb 3, 2023
oranagra
reviewed
Feb 4, 2023
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.
please add a reference in the top comment to the PR you refer to (i assume it's #10587, right?)
Co-authored-by: Oran Agra <oran@redislabs.com>
oranagra
approved these changes
Feb 6, 2023
oranagra
added
the
release-notes
indication that this issue needs to be mentioned in the release notes
label
Feb 6, 2023
Mixficsol
pushed a commit
to Mixficsol/redis
that referenced
this pull request
Apr 12, 2023
…1779) If we have integer scores on the sorted set we're not using the fastest way to reply by calling `d2string` which uses `double2ll` and `ll2string` when it can, instead of `fpconv_dtoa`. This results by some 50% performance improvement in certain cases of integer scores for both RESP2 and RESP3, and no apparent impact on double scores. Co-authored-by: Oran Agra <oran@redislabs.com>
enjoy-binbin
pushed a commit
to enjoy-binbin/redis
that referenced
this pull request
Jul 31, 2023
…1779) If we have integer scores on the sorted set we're not using the fastest way to reply by calling `d2string` which uses `double2ll` and `ll2string` when it can, instead of `fpconv_dtoa`. This results by some 50% performance improvement in certain cases of integer scores for both RESP2 and RESP3, and no apparent impact on double scores. Co-authored-by: Oran Agra <oran@redislabs.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
action:run-benchmark
Triggers the benchmark suite for this Pull Request
release-notes
indication that this issue needs to be mentioned in the release notes
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I started looking at the profile of
ZRANGE
related commands, likeZREVRANGEBYSCORE
due to the benchmark we've added https://github.com/redis/redis-benchmarks-specification/blob/main/redis_benchmarks_specification/test-suites/memtier_benchmark-1key-zrevrangebyscore-256K-elements-pipeline-1.yml .putting it simple, if we have integer scores on the sorted set we're not using the fastest way to reply by calling
d2string
which usesdouble2ll
andll2string
when it can, instead offpconv_dtoa
.To reproduce:
populate sorted sets (cardinality is not really important here -- the score reply type yes) :
benchmark:
profile info:
Notice that
addReplyDouble
is taking ~36% of CPU cycles:Impact of this PR in the achievable ops/sec for both double and long scores:
Note that the existing change in unstable missing in 7.0 is #10587