Pre-allocating the memory