Testing long RCE
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Sun Dec 5 11:41:53 UTC 2021
Hi Rado,
to achieve performance parity in existing benchmarks there's another
piece we need:
https://bugs.openjdk.java.net/browse/JDK-8276116
Without that patch, the VM only optimizes if it detects a loop on a long
variable (but all our benchmarks use an int variable).
I suggest you use this branch (against jdk/jdk):
https://github.com/mcimadamore/jdk/tree/long_loop_workarounds_removal
Which contains full removal of existing workaround - I've been testing
this with Roland over the last few months.
Cheers
Maurizio
On 04/12/2021 18:49, Rado Smogura wrote:
> Hi all,
>
> I tried to test long range checks 8259609 - as this is long awaiting
> thing. I'm not sure if I do something wrong, but I can't get a good
> results
>
>
> Approach 1.
> LoopOverNonConstant.segment_loop change int to long as counter
>
> AbstractMemorySegmentImpl.checkBounds I used followed code
>
> if (length < 0) {
> throw outOfBoundException(offset, length);
> }
>
> Objects.checkIndex(offset, this.length - (length - 1));
>
> Results were like Iteration 8: 0.376 ms/op
>
>
> Approach 2
>
> AbstractMemorySegmentImpl.checkBounds use code like in 1, but without
> segment_loop changes
>
> Iteration 8: 0.239 ms/op
>
> Approach 3 - original test
> Iteration 8: 0.230 ms/op
>
> Sorry for not posting whole results (just grabbed partial results). In
> graph as well I can see number of range checks in main loop :(
>
> Kind regards,
> Rado
>
More information about the panama-dev
mailing list