speedup compression some more with local buffer on stack