Implements lazy buffer rotations#415
Conversation
|
An automated preview of the documentation is available at https://415.redis.prtest3.cppalliance.org/libs/redis/doc/html/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-05-09 17:32:23 UTC |
|
Thanks. Will have a look soon. |
53e42d1 to
83dcec3
Compare
|
Since GH seems buggy, I'll place my review in a comment to avoid losing it:
|
|
I've confirmed with vtune that the reader now takes less proportion of CPU time. Memmove no longer appears in the flame graph. Feel free to merge this when you want. Something that'd be interesting is rewriting the read buffer without a vector, directly with a |
The read buffer won't rotate data if it can be increased without allocating
more memory. The table below compares the performance before and after the
changes
| time(s) | %usr | %sys | %CPU | rotation
------|---------| ------|------|-------|------------
Eager | 92.22 | 67.37 | 2.92 | 70.29 | 6.7 Gbps
Lazy | 91.16 | 60.15 | 2.82 | 62.97 | 99.0 kbps
The biggest gain in the benchmark above is in CPU usage because the overall
time cannot be decreased much since the client is far from saturating the CPU.
83dcec3 to
45294d3
Compare
|
Thanks Ruben, I addressed all comments. AppVeyor is reporting Do you know how to fix this? |
|
Appveyor is still not functional, please ignore whatever it reports for now. |
I agree this should be done later. |
The read buffer won't rotate data if it can be increased without allocating more memory. The table below compares the performance before and after the changes
The biggest gain in the benchmark above is in CPU usage because the overall time cannot be decreased much since the client is far from saturating the CPU.