3 ms·
LPUSHX got my attention so I opened a pull request making it variadic (along with other commands) three years ago [1]. Of course since then the codebase changed
by catwell 10y ago
LPUSHX got my attention so I opened a pull request making it variadic (along with other commands) three years ago [1]. Of course since then the codebase changed and it can no longer be merged.
If there is still interest I could try to fix it, although I don't use Redis as much anymore and I have not looked at its code for a long time.
[1] https://github.com/antirez/redis/pull/1232 https://github.com/antirez/redis/pull/1232
- dvirsky 10y agotry to go on the #redis freenode channel and ask antirez about it.
- antirez 10y agoHey! Yes I'm interested, the PR was not handled for the usual reasons but making the commands variadic is a good idea. However I'm surprised there is not just the need to change the command table since I remembered, incorrectly, all the variants were handled by a single function.
- catwell 10y agoYeah, as you can see the issue was that it is a different function, pushxGenericCommand(), which is used for LPUSHX, RPUSHX and LINSERT. For me having the same function for LPUSHX / RPUSHX and LINSERT does not make much sense (it uses different code depending on whether or not an argument is NULL anyway) so I had started by making LINSERT not rely on it. My initial goal at the time was not to make LPUSHX and RPUSHX variadic, since like you said they are not used so much. It was actually to make LINSERT variadic, which can result in a significant performance boost compared to calling it several times. Anyway, I will try to find the time to adapt it to the current code base.