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 bb00154f0e
commit a11ae385e9
5 changed files with 43 additions and 25 deletions

View File

@ -507,6 +507,7 @@ struct redisClient *createFakeClient(void) {
c->reply_bytes = 0;
c->obuf_soft_limit_reached_time = 0;
c->watched_keys = listCreate();
c->peerid = NULL;
listSetFreeMethod(c->reply,decrRefCountVoid);
listSetDupMethod(c->reply,dupClientReplyValue);
initClientMultiState(c);