summaryrefslogtreecommitdiff
path: root/src/server.h
diff options
context:
space:
mode:
authorfilipe oliveira <filipecosta.90@gmail.com>2022-11-30 20:08:12 +0000
committerGitHub <noreply@github.com>2022-11-30 22:08:12 +0200
commit68e87eb0883abf542fd8a38fc51f462eca8b5a4f (patch)
tree63b2487d2cd013d39b99373890b66929308c88aa /src/server.h
parentb0250b4508c9ed527fb0c885f615ae97975f3b2d (diff)
downloadredis-68e87eb0883abf542fd8a38fc51f462eca8b5a4f.tar.gz
changing addReplySds and sdscat to addReplyStatusLength() within luaReplyToRedisReply() (#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%
Diffstat (limited to 'src/server.h')
-rw-r--r--src/server.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/server.h b/src/server.h
index 9dfbf81b7..105b2db4e 100644
--- a/src/server.h
+++ b/src/server.h
@@ -2507,6 +2507,7 @@ void addReplyBulkCString(client *c, const char *s);
void addReplyBulkCBuffer(client *c, const void *p, size_t len);
void addReplyBulkLongLong(client *c, long long ll);
void addReply(client *c, robj *obj);
+void addReplyStatusLength(client *c, const char *s, size_t len);
void addReplySds(client *c, sds s);
void addReplyBulkSds(client *c, sds s);
void setDeferredReplyBulkSds(client *c, void *node, sds s);