speed-up: fixed bug in caching of compression lengths