Remove unnecessary replication backlog memory copy (#9157)
in the past, the reply list was a list of sds objects, so this didn't have any overhead, but now addReplySds just copies the data from the sds and frees it, so there's no need to make a copy of the buffer before copying again. this reduces an excessive allocation and free and a memcpy.
This commit is contained in:
parent
1071430875
commit
4fa3e23092
@ -463,7 +463,7 @@ long long addReplyReplicationBacklog(client *c, long long offset) {
|
||||
(server.repl_backlog_size - j) : len;
|
||||
|
||||
serverLog(LL_DEBUG, "[PSYNC] addReply() length: %lld", thislen);
|
||||
addReplySds(c,sdsnewlen(server.repl_backlog + j, thislen));
|
||||
addReplyProto(c,server.repl_backlog + j, thislen);
|
||||
len -= thislen;
|
||||
j = 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user