Bellow is the VTTablet allocation space flame graph.
Query Result to Proto conversion and MySQL packets to Row conversion takes almost ~43% space.
This can be avoided with the new grpc codec2 that allows Buffers to be passed through to grpc transport layer without additional allocation.
We will utilize this codec2 by skipping row packets parsing at VTTablet and also not converting them from Query Result to proto using the grpc mem.BufferSlice. This reduction in allocation should reflect in out allocation and cpu time leading to better query latency.
We might see little higher unmarshal time at VTGate for converting raw packets to result rows. But it will outweight the benefits of avoiding at VTTablet.
Bellow is the VTTablet allocation space flame graph.
Query Result to Proto conversion and MySQL packets to Row conversion takes almost ~43% space.
This can be avoided with the new grpc codec2 that allows Buffers to be passed through to grpc transport layer without additional allocation.
We will utilize this codec2 by skipping row packets parsing at VTTablet and also not converting them from Query Result to proto using the grpc mem.BufferSlice. This reduction in allocation should reflect in out allocation and cpu time leading to better query latency.
We might see little higher unmarshal time at VTGate for converting raw packets to result rows. But it will outweight the benefits of avoiding at VTTablet.
More graphs will be updated after doing a POC.