RFR (S) 8146801: Allocating short arrays of non-constant size is slow

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Wed Mar 2 12:32:23 UTC 2016


I think it heavily depends on prefetch strategy:

   product(intx,  AllocatePrefetchStyle, 1,
           "0 = no prefetch, "
           "1 = prefetch instructions for each allocation, "
           "2 = use TLAB watermark to gate allocation prefetch, "
           "3 = use BIS instruction on Sparc for allocation prefetch")

Maybe prefetch distance and the number of prefetched lines is too much 
for small array allocations and it should be treated like an ordinary 
object allocation:

       // Generate several prefetch instructions.
       uint lines = (length != NULL) ? AllocatePrefetchLines : 
AllocateInstancePrefetchLines;
       uint step_size = AllocatePrefetchStepSize;
       uint distance = AllocatePrefetchDistance;

But I'm not sure how much such optimization can buy us for the 
additional complexity in the code.

Best regards,
Vladimir Ivanov

On 3/2/16 1:53 AM, Vitaly Davidovich wrote:
> Related question - can the prefetch hints go away for small array
> allocations considering size is already being branched on? I've noticed
> allocations always come with a prefetch sequence, so perhaps this is
> just standard allocation pattern.
>
> On Tuesday, March 1, 2016, Vladimir Kozlov <vladimir.kozlov at oracle.com
> <mailto:vladimir.kozlov at oracle.com>> wrote:
>
>     Perfect!
>
>     Thanks,
>     Vladimir
>
>     On 3/1/16 1:46 PM, Aleksey Shipilev wrote:
>
>         On 03/01/2016 08:03 PM, Vladimir Kozlov wrote:
>
>             Do you have new performance numbers? I hope it did not
>             regress with new
>             code.
>
>
>         It does not regress, the code is tight:
>         http://cr.openjdk.java.net/~shade/8146801/notes.txt
>
>             2 things left I fill should be addressed.
>
>
>         Both are fixed here:
>         http://cr.openjdk.java.net/~shade/8146801/webrev.06/
>
>         Still passes JPRT -testset hotspot; RBT run is in progress.
>
>         Cheers,
>         -Aleksey
>
>
>
> --
> Sent from my phone


More information about the hotspot-compiler-dev mailing list