perf improvement in gen_chunk_buffer via reduced map_get calls