Patch to improve primitives Array.sort()

Chan, Sunny Sunny.Chan at
Fri May 15 09:48:11 UTC 2015

I have provided Paul with an updated patch:

* The test has been updated using data provider and reduce as much repetition as possible.
* The GS copyright notice from the main JDK patch. However we retain it on our test cases as we developed ourselves. In our previous contributions where we provided new tests we have put our copyright along with oracle copyright and it was accepted (see:
* Alan has commented that there were older benchmark but searching through the archive I can see it mention "BentleyBasher" I cannot find the actual code that Vladimir used (thread: Is there anywhere I can get hold of it?


-----Original Message-----
From: O'Leary, Kristen [Tech] 
Sent: 11 May 2015 23:33
To: 'Alan Bateman'; Paul Sandoz; Chan, Sunny [Tech]
Cc: 'core-libs-dev at'; Rezaei, Mohammad A. [Tech]
Subject: RE: Patch to improve primitives Array.sort()

Hi Alan,

For MAX_RUN_LENGTH, the constant was used to limit the size of a run when the numbers were equal. We treat equal numbers as part of the same run and do not require such a limitation.

We have created a consolidated test based upon your feedback and Sunny will work on getting a new revision sent out.


-----Original Message-----
From: Alan Bateman [mailto:Alan.Bateman at] 
Sent: Friday, April 24, 2015 5:09 AM
To: Paul Sandoz; Chan, Sunny [Tech]
Cc: 'core-libs-dev at'; O'Leary, Kristen [Tech]
Subject: Re: Patch to improve primitives Array.sort()

On 24/04/2015 09:57, Paul Sandoz wrote:
> See here:
> Some very quick comments as i have not yet had time to review more closely:
> - IANAL so i dunno about the GS copyright in the files.
> - The constant MAX_RUN_LENGTH is no longer used so could be removed. But i would like to understand why it's no longer required.
> - There is quite a bit of duplication in the tests. AFAICT data sources are all derived from ints that are then converted. The sources could be data providers, so only one test method per data type is required, each data can come with a descriptive string so it shows up in the test reports. The goal here being if another source of data is added (which is derivable) it could be added just once.
Also overall with the existing Sorting test should be examined as it tests a lot of cases with varying data sizes (and consequentially runs for a long time). We should also go back through the archives for all the other benchmarks that were created in the move to the dual pivot implementation.


More information about the core-libs-dev mailing list