accumulate data based on its length rather than the size of the buffer
tiny benchmark framework and a benchmark to determine the optimal number of bytes to read from a socket