Josh Bloch writes:
Hi. The reason is that I thought that cloning the array was faster
when I wrote the code. I was wrong. Unless I'm missing something,
this should be fixed. I'm copying Martin Buchholz at Sun in the hopes
that he'll fix it or pass it on to someone else at Sun to fix. I'm
copying Neal and Doug because I think they'll be interested.
On Mon, 15 Nov 2004 18:11:17 -0800, Wolfgang Hoschek <###@###.###> wrote:
>> just a quick question since you're probably busy.
>> In java.util.Arrays.sort(Object) and range based cousin, to set up
>> the temporary buffer array, why not simply use "new Object[size]" and
>> then System.arraycopy instead of clone() or reflection in
>> cloneSubArray()? My understanding is that System.arraycopy is faster
>> than clone().
>> When frequently sorting small arrays on jdk 1.5.0 server, VM clone()
>> shows up with 14% when profiling with the non-perturbing flags '-server
>> This is with our binary xml codec:
>> TRACE 300256:
>> java.lang.Object.clone(Object.java:Unknown line)
###@###.### 2004-11-16 04:44:31 GMT