Zeroing out memory is necessarily slower than not. In C, it sometimes has "random" behavior because the compiler will not generate instructions to clear the memory before you variables are assigned it. Otherwise, you have to do somewhat expensice memory operations. Of course, every variable eventually needs a value, but initially some variables in Java (class variables, for example), are initialized to zero regardless of what you set them to.
The only difference here is whether or not the language needs to go so far as to initialize all variables to a preset for you
Zeroing out memory is necessarily slower than not.
And this can actually e seen in java by using the list.toArray() methods. The method that passes in a zero element array is faster than a preinitialized array, simply because pre-initialized array costs time to zero, where as thr empty array is actuallt not initialised, as it uses a native implementation.
Do you have a source for this? AFAIK the array is only ever used to get the type of the array. The length is irrelevant as Java always creates a new array with the correct type (inspected from the one you passed in) and length (based on the list)
Speed differences might come down to creating two "full length" arrays instead of just one (and an empty array).
What is the "native implementation"?