RFR[S]:8241874 [PPC64] Improve performance of Long.reverseBytes() and Integer.reverseBytes() on Power9
Corey Ashford
cjashfor at linux.ibm.com
Thu Apr 16 01:34:46 UTC 2020
Hello Martin,
I'm having some trouble with my email server, so I'm having to reply to
your earlier post, but I saw your most recent post on the mailing list
archive.
Thanks for reviewing and testing this patch. I went to look at the
copyright dates, and see two date ranges: one for Oracle and its
affiliates, and another for SAP. In the files I looked at, the end date
wasn't the same between the two. Which one (or both) should I modify?
Thanks,
- Corey
On 4/14/20 6:26 AM, Doerr, Martin wrote:
> Hi Corey,
>
> thanks for contributing it. Looks good to me. I’ll run it through our
> testing and let you know about the results.
>
> Best regards,
>
> Martin
>
> *From:*ppc-aix-port-dev <ppc-aix-port-dev-bounces at openjdk.java.net> *On
> Behalf Of *Michihiro Horie
> *Sent:* Freitag, 10. April 2020 10:48
> *To:* cjashfor at linux.ibm.com
> *Cc:* hotspot-compiler-dev at openjdk.java.net;
> ppc-aix-port-dev at openjdk.java.net
> *Subject:* Re: RFR[S]:8241874 [PPC64] Improve performance of
> Long.reverseBytes() and Integer.reverseBytes() on Power9
>
> Hi Corey,
>
> Thank you for sharing your benchmarks. I confirmed your change reduced
> the elapsed time of the benchmarks by more than 30% on my P9 node. Also,
> I checked JTREG results, which look no problem.
>
> BTW, I cannot find further points of improvement in your change.
>
> Best regards,
> Michihiro
>
>
> ----- Original message -----
> From: "Corey Ashford" <cjashfor at linux.ibm.com
> <mailto:cjashfor at linux.ibm.com>>
> To: Michihiro Horie/Japan/IBM at IBMJP
> Cc: hotspot-compiler-dev at openjdk.java.net
> <mailto:hotspot-compiler-dev at openjdk.java.net>,
> ppc-aix-port-dev at openjdk.java.net
> <mailto:ppc-aix-port-dev at openjdk.java.net>, "Gustavo Romero"
> <gromero at linux.vnet.ibm.com <mailto:gromero at linux.vnet.ibm.com>>
> Subject: Re: RFR[S]:8241874 [PPC64] Improve performance of
> Long.reverseBytes() and Integer.reverseBytes() on Power9
> Date: Fri, Apr 3, 2020 8:07 AM
>
> On 4/2/20 7:27 AM, Michihiro Horie wrote:
>> Hi Corey,
>>
>> I’m not a reviewer, but I can run your benchmark in my local P9 node if
>> you share it.
>>
>> Best regards,
>> Michihiro
>
> The tests are somewhat hokey; I added the shifts to keep the compiler
> from hoisting the code that it could predetermine the result.
>
> Here's the one for Long.reverseBytes():
>
> import java.lang.*;
>
> class ReverseLong
> {
> public static void main(String args[])
> {
> long reversed, re_reversed;
> long accum = 0;
> long orig = 0x1122334455667788L;
> long start = System.currentTimeMillis();
> for (int i = 0; i < 1_000_000_000; i++) {
> // Try to keep java from figuring out stuff in advance
> reversed = Long.reverseBytes(orig);
> re_reversed = Long.reverseBytes(reversed);
> if (re_reversed != orig) {
> System.out.println("Orig: " + String.format("%16x", orig) +
> " Re-reversed: " + String.format("%16x", re_reversed));
> }
> accum += orig;
> orig = Long.rotateRight(orig, 3);
> }
> System.out.println("Elapsed time: " +
> Long.toString(System.currentTimeMillis() - start));
> System.out.println("accum: " + Long.toString(accum));
> }
> }
>
>
> And the one for Integer.reverseBytes():
>
> import java.lang.*;
>
> class ReverseInt
> {
> public static void main(String args[])
> {
> int reversed, re_reversed;
> int orig = 0x11223344;
> int accum = 0;
> long start = System.currentTimeMillis();
> for (int i = 0; i < 1_000_000_000; i++) {
> // Try to keep java from figuring out stuff in advance
> reversed = Integer.reverseBytes(orig);
> re_reversed = Integer.reverseBytes(reversed);
> if (re_reversed != orig) {
> System.out.println("Orig: " + String.format("%08x", orig) +
> " Re-reversed: " + String.format("%08x", re_reversed));
> }
> accum += orig;
> orig = Integer.rotateRight(orig, 3);
> }
> System.out.println("Elapsed time: " +
> Long.toString(System.currentTimeMillis() - start));
> System.out.println("accum: " + Integer.toString(accum));
> }
> }
>
More information about the ppc-aix-port-dev
mailing list