Using the lrange benchmarks of redis benchmark ( I was investigating it due to #10981 ) we can see that we're wasting a large ammount of cpu cycles on sdslen() computing the sizes we already know:
- 77.55% lrangeCommand ▒
- 77.31% addListRangeReply ▒
+ 35.46% addReplyBulkCBuffer ▒
+ 21.34% listTypeNext (inlined) ▒
- 11.32% addReply (inlined) ▒
6.55% sdslen (inlined) ▒
0.41% _addReplyToBufferOrList (inlined) ▒
+ 6.88% _addReplyToBufferOrList (inlined) ▒
+ 0.60% addReplyLongLongWithPrefix ▒
0.50% prepareClientToWrite ▒
0.15% listTypeReleaseIterator (inlined)