Commit 38dd30af authored by Salvatore Sanfilippo's avatar Salvatore Sanfilippo Committed by GitHub
Browse files

Merge pull request #4105 from spinlock/unstable-networking

Optimize addReplyBulkSds for better performance
parents 2d5aa009 10db81af
...@@ -254,7 +254,7 @@ lcov: ...@@ -254,7 +254,7 @@ lcov:
@genhtml --legend -o lcov-html redis.info @genhtml --legend -o lcov-html redis.info
test-sds: sds.c sds.h test-sds: sds.c sds.h
$(REDIS_CC) sds.c zmalloc.c -DSDS_TEST_MAIN -o /tmp/sds_test $(REDIS_CC) sds.c zmalloc.c -DSDS_TEST_MAIN $(FINAL_LIBS) -o /tmp/sds_test
/tmp/sds_test /tmp/sds_test
.PHONY: lcov .PHONY: lcov
......
...@@ -561,8 +561,7 @@ void addReplyBulkCBuffer(client *c, const void *p, size_t len) { ...@@ -561,8 +561,7 @@ void addReplyBulkCBuffer(client *c, const void *p, size_t len) {
/* Add sds to reply (takes ownership of sds and frees it) */ /* Add sds to reply (takes ownership of sds and frees it) */
void addReplyBulkSds(client *c, sds s) { void addReplyBulkSds(client *c, sds s) {
addReplySds(c,sdscatfmt(sdsempty(),"$%u\r\n", addReplyLongLongWithPrefix(c,sdslen(s),'$');
(unsigned long)sdslen(s)));
addReplySds(c,s); addReplySds(c,s);
addReply(c,shared.crlf); addReply(c,shared.crlf);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment