Now doing a more intelligent initial buffer allocation for cache serialization.
Minor optimizations to cache serialization.