9678b69c1e
Michael Davidsaver pointed out that the original algorithm used is dumb, it can't reuse empty space at the beginning until all messages have been drained. This new version can, and is more efficient.