Optimize and speed up compression.