CLIENT LIST speedup via peerid caching + smart allocation.

This commit adds peer ID caching in the client structure plus an API
change and the use of sdsMakeRoomFor() in order to improve the
reallocation pattern to generate the CLIENT LIST output.

Both the changes account for a very significant speedup.
This commit is contained in:
antirez
2014-04-28 17:36:57 +02:00
parent f9a4a80f49
commit 0bcc7cb4bf
5 changed files with 43 additions and 25 deletions

View File

@ -701,7 +701,7 @@ void logCurrentClient(void) {
int j;
redisLog(REDIS_WARNING, "--- CURRENT CLIENT INFO");
client = getClientInfoString(cc);
client = catClientInfoString(sdsempty(),cc);
redisLog(REDIS_WARNING,"client: %s", client);
sdsfree(client);
for (j = 0; j < cc->argc; j++) {