currently lua scripts call a client that writes a response like (if the response were: [3,4,5])
this string is then parsed in redisProtocolToLuaType() to be 3 integers, which are put onto lua's stack.
The first step could push an integer onto the stack instead of writing ":3\r\n" by overriding the logic in addReply() to have a different behaviour if the redisClient is the server.lua_client. This skips doing a write (":3/r/n") and a parse (":3\r\n")
bug #392 was a repeat of this one, it has an alternate explanation of what I was trying to say and may be worth looking at.
I agree this needs to be tackled, but I want to take a strong look at the existing networking code and see if we can extract a unified API that either writes a reply or puts a reply on the Lua stack. The protocol writing and parsing for every call is pretty low hanging fruit performance-wise ;-)
good stuff, you understood exactly what I meant :)
good luck on it, it is kind of a lot of code, but once refactored, should be much less code, so that is a good thing too.
as always thanks,
Russ (aka: jaksprats)
Things against this proposal, now very old btw: