optimize Batched_store._with_key_in_caches