changing addReplySds and sdscat to addReplyStatusLength() within luaReplyToRedisReply()#11556
Merged
oranagra merged 5 commits intoredis:unstablefrom Nov 30, 2022
Merged
Conversation
oranagra
reviewed
Nov 29, 2022
Member
oranagra
left a comment
There was a problem hiding this comment.
so specifically, status replies were inefficient, but other type of replies are ok?
i guess the most common ones are status, bulk, and array.
from all the reply types i see the only one that was composing a protocol rather than calling a helper function was status.
sundb
reviewed
Nov 30, 2022
Co-authored-by: sundb <[email protected]>
oranagra
reviewed
Nov 30, 2022
oranagra
approved these changes
Nov 30, 2022
This was referenced Dec 4, 2022
Merged
oranagra
pushed a commit
that referenced
this pull request
Dec 12, 2022
…eplyToRedisReply() (#11556) profiling EVALSHA\ we see that luaReplyToRedisReply takes 8.73% out of the 56.90% of luaCallFunction CPU cycles. Using addReplyStatusLength instead of directly composing the protocol to avoid sdscatprintf and addReplySds ( which imply multiple sdslen calls ). The new approach drops luaReplyToRedisReply CPU cycles to 3.77% (cherry picked from commit 68e87eb)
madolson
pushed a commit
to madolson/redis
that referenced
this pull request
Apr 19, 2023
…eplyToRedisReply() (redis#11556) profiling EVALSHA\ we see that luaReplyToRedisReply takes 8.73% out of the 56.90% of luaCallFunction CPU cycles. Using addReplyStatusLength instead of directly composing the protocol to avoid sdscatprintf and addReplySds ( which imply multiple sdslen calls ). The new approach drops luaReplyToRedisReply CPU cycles to 3.77%
enjoy-binbin
pushed a commit
to enjoy-binbin/redis
that referenced
this pull request
Jul 31, 2023
…eplyToRedisReply() (redis#11556) profiling EVALSHA\ we see that luaReplyToRedisReply takes 8.73% out of the 56.90% of luaCallFunction CPU cycles. Using addReplyStatusLength instead of directly composing the protocol to avoid sdscatprintf and addReplySds ( which imply multiple sdslen calls ). The new approach drops luaReplyToRedisReply CPU cycles to 3.77%
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
profiling EVALSHA after the merge of #11521 ( commit 7dfd7b9 ) we can see that luaReplyToRedisReply takes 8.73% out of the 56.90% of luaCallFunction CPU cycles. The new approach drops luaReplyToRedisReply CPU cycles to 3.77%
using addReplyStatusLength instead of directly composing the protocol to avoid sdscatprintf and addReplySds ( which imply multiple sdslen calls ) we get the following improvement on the overall ops/sec: