Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
38dd30af
Commit
38dd30af
authored
Jul 06, 2017
by
Salvatore Sanfilippo
Committed by
GitHub
Jul 06, 2017
Browse files
Merge pull request #4105 from spinlock/unstable-networking
Optimize addReplyBulkSds for better performance
parents
2d5aa009
10db81af
Changes
2
Show whitespace changes
Inline
Side-by-side
src/Makefile
View file @
38dd30af
...
...
@@ -254,7 +254,7 @@ lcov:
@
genhtml
--legend
-o
lcov-html redis.info
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
.PHONY
:
lcov
...
...
src/networking.c
View file @
38dd30af
...
...
@@ -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) */
void
addReplyBulkSds
(
client
*
c
,
sds
s
)
{
addReplySds
(
c
,
sdscatfmt
(
sdsempty
(),
"$%u
\r\n
"
,
(
unsigned
long
)
sdslen
(
s
)));
addReplyLongLongWithPrefix
(
c
,
sdslen
(
s
),
'$'
);
addReplySds
(
c
,
s
);
addReply
(
c
,
shared
.
crlf
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment