RFR: 8276455: C2: iterative EA
Roland Westrelin
roland at openjdk.java.net
Tue Dec 14 08:48:21 UTC 2021
On Wed, 3 Nov 2021 01:44:49 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
> Resolve C2 issue with nested initialization when Escape Analysis can not scalarize allocations: `new A(new B( new C)))`
> Implemented iterative EA when C2 invokes it again if there are progress and candidates.
>
> I added JMH microbenchmark with cases which show improvements. Improvements are due to removed allocation code.
>
> Before:
>
> Benchmark Mode Cnt Score Error Units
> IterativeEA.test1 avgt 5 11.489 ± 3.037 ns/op
> IterativeEA.test2 avgt 5 16.103 ± 3.686 ns/op
> IterativeEA.test3 avgt 5 1988.827 ± 217.831 ns/op
>
> With these changes:
>
> IterativeEA.test1 avgt 5 2.182 ± 0.022 ns/op
> IterativeEA.test2 avgt 5 2.375 ± 0.001 ns/op
> IterativeEA.test3 avgt 5 821.011 ± 8.268 ns/op
>
>
> An other JMH test:
>
> PointerBenchmarkFlat.test avgt 30 23.232 ± 6.507 ms/op
>
> vs
>
> PointerBenchmarkFlat.test avgt 30 0.299 ± 0.001 ms/op
That looks good to me.
Have you measured how compile time is affected?
-------------
Marked as reviewed by roland (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/6222
More information about the hotspot-compiler-dev
mailing list