compiler optimisation for compress / decompress

compiler optimisation for compress and decompress methods.