RFR: JDK-8224963: Char-Byte Performance Enhancement
vladimir.x.ivanov at oracle.com
Wed May 29 16:19:36 UTC 2019
Among all options, I'm in favor of enhancing C2 to produce better code.
Then on my preference list goes rewriting JDK code to make it amenable
to missing optimizations (the patch you propose). And, as a last resort,
I'd consider introducing new intrinsics.
The microbenchmarks would help understand what pieces as missing in C2
and decide how to proceed.
I haven't had HotSpot vs J9 comparison in mind, but in absence of
benchmarks available comparing generated code (by C2) between original
and updated JDK version would help understand what goes wrong.
On 29/05/2019 17:53, Adam Farley8 wrote:
> Hi Vladimir,
> I have a locally-written performance test I used to get the "6x".
> Will chase up with the guy who wrote it to see if I can share it.
> If not, I'll write a new one.
> As for the enhancements, two options are:
> - matching on the new method names, and replacing the inner logic
> with some souped-up version of said logic.
> - alter the code to match on one of the C2 idioms, though I imagine
> if it were that simple, OpenJDK would come with a list of said
> idioms so everything people write can be easily accelerated by the
> As for how OpenJ9 does it specifically, I don't know, and I suspect
> it's safer if I don't find out, contamination-wise.
> Does any of that help?
> Best Regards
> Adam Farley
> IBM Runtimes
> Vladimir Ivanov <vladimir.x.ivanov at oracle.com> wrote on 29/05/2019 13:22:27:
>> From: Vladimir Ivanov <vladimir.x.ivanov at oracle.com>
>> To: Adam Farley8 <adam.farley at uk.ibm.com>, hotspot-compiler-
>> dev at openjdk.java.net
>> Date: 29/05/2019 13:22
>> Subject: Re: RFR: JDK-8224963: Char-Byte Performance Enhancement
>> Hi Adam,
>> The bug mentions ~6x improvement in throughput. Are there have any
>> microbenchmarks you can share which demonstrate that? That would greatly
>> simplify the analysis of changes you propose.
>> Also, if you can elaborate on what optimization opportunities C2 misses
>> in original code, please, do.
>> Best regards,
>> Vladimir Ivanov
>> On 29/05/2019 12:45, Adam Farley8 wrote:
>> > Hi All,
>> > Could someone familiar with the Hotspot JIT please review and opine on
>> > the below?
>> > The Char-Byte encoding/decoding methods inside some of the sun.nio.cs
>> > classes
>> > (such as US_ASCII) see a lot of use, and OpenJDK on the OpenJ9 VM seems to
>> > do this a lot faster.
>> > Is it possible to achieve a similar improvement on OpenJDK on Hotspot by
>> > tweaking the CL code to match Hotspot JIT compiler idioms, or by
>> > introducing
>> > a method name for the HS JIT to match on?
>> > An example of these changes to US_ASCII.java is linked below. No OpenJ9
>> > code
>> > is included in the work item or the webrev, to avoid contamination.
>> > Work item: https://urldefense.proofpoint.com/v2/url?
>> > Example Webrev: _https://urldefense.proofpoint.com/v2/url?
>> > Best Regards
>> > Adam Farley
>> > IBM Runtimes
>> > Unless stated otherwise above:
>> > IBM United Kingdom Limited - Registered in England and Wales with number
>> > 741598.
>> > Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with number
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
More information about the hotspot-compiler-dev