Replacement of Quicksort in java.util.Arrays with Dual-Pivot Quicksort

Vladimir Yaroslavskiy Vladimir.Yaroslavskiy at Sun.COM
Fri Sep 18 10:53:02 UTC 2009


> Date: Thu, 17 Sep 2009 12:00:57 +0000 (UTC)
> From: Ismael Juma <mlists at juma.me.uk>
> Subject: Re: Replacement of Quicksort in java.util.Arrays with Dual-Pivot
> To: core-libs-dev at openjdk.java.net
> 
> Hi Vladimir,
> 
> Vladimir Yaroslavskiy <Vladimir.Yaroslavskiy at ...> writes:
>>    random 01           random 01
>> dpq: 1431           dpq: 8017
>> tim: 11495          tim: 2717
>> jdk: 1552           jdk: 8547
> 
> Is the size of the int array different than the size of the j.l.Integer array? I
> ask because I would be surprised if timsort were that much faster when sorting
> an array of j.l.Integers versus sorting an array of ints.
> 
> Best,
> Ismael

Hello Ismael,

You are right, the arrays were different: int array was 2'000'000
and Integer array was 200'000 (and test was run 50 times) - if I
remember correctly.

Now I've run test on the same length 2'000'000 arrays 50 times,
see the result (client VM):

int  random   Integer random
dpq: 16222       dpq: 166313
tim: 36022       tim: 147783
jdk: 20699       jdk: 133578

Thank you,
Vladimir



More information about the core-libs-dev mailing list