Rewrite the protocol handling for better performances characteristics.
The qmynd wire-protocol implementation was eagerly loading up the whole content of a MySQL packet as a sequence of unsigned-bytes in memory, only to then read from a stream built on-top of that sequence. The new wire-packet implementation is a transparent stream where the next packet's chunk is crossed transparently from within read-my-byte and read-my-sequence calls, resulting in only fetching the data we need at any time and bypassing all the stream to sequence of bytes to stream again in the parsing of the data. In passing, we also fix the handling of data as text. Tests ran against this code show it about twice as fast as the previous coding in best cases, and when disabling compression. There's now an option to disable it at connection time (default to disable), because it's unexpected to see compression offering any gain on a "local" connection anyway, even more when using salza and chipz.
parent
2b0807c4
Please register or sign in to comment