Re: RFR: 8238669: Long.divideUnsigned is extremely slow for certain values (Needs to be Intrinsic) [v3]

2020-10-21 Thread Brian Burkhalter
On Mon, 19 Oct 2020 14:58:22 GMT, Raffaello Giulietti wrote: >> This is a follow-up of the Mercurial-based workflow initiated on the >> core-lib-devs mailing list [0]. Not sure if this one is strictly necessary >> or if the patches sent on the list are sufficient. Anyway, I exploit this PR >>

Re: RFR: 8238669: Long.divideUnsigned is extremely slow for certain values (Needs to be Intrinsic) [v2]

2020-10-19 Thread Brian Burkhalter
On Mon, 19 Oct 2020 15:18:58 GMT, Raffaello Giulietti wrote: >> I think the change looks good. >> >> Before the project was on GitHub, there was a change to the test posted in >> http://mail.openjdk.java.net/pipermail/core-libs-dev/2020-September/068504.html >> to address the comment in >> htt

Re: RFR: 8238669: Long.divideUnsigned is extremely slow for certain values (Needs to be Intrinsic) [v2]

2020-10-19 Thread Raffaello Giulietti
On Sat, 17 Oct 2020 00:16:57 GMT, Brian Burkhalter wrote: >> Hello, >> >> a reminder that this issue has not been formally reviewed. >> Estimated time: 10-15 min with "Hacker's delight" on the desk. >> >> Greetings >> Raffaello > > I think the change looks good. > > Before the project was on G

Re: RFR: 8238669: Long.divideUnsigned is extremely slow for certain values (Needs to be Intrinsic) [v3]

2020-10-19 Thread Raffaello Giulietti
> This is a follow-up of the Mercurial-based workflow initiated on the > core-lib-devs mailing list [0]. Not sure if this > one is strictly necessary or if the patches sent on the list are sufficient. > Anyway, I exploit this PR as a test ;-) > [0] > https://mail.openjdk.java.net/pipermail/core-

Re: RFR: 8238669: Long.divideUnsigned is extremely slow for certain values (Needs to be Intrinsic) [v2]

2020-10-16 Thread Brian Burkhalter
On Wed, 14 Oct 2020 14:20:11 GMT, Raffaello Giulietti wrote: >> Hello >> >> this is a gentle reminder that this issue still needs a more formal review. >> >> Greetings >> Raffaello > > Hello, > > a reminder that this issue has not been formally reviewed. > Estimated time: 10-15 min with "Hack

Re: RFR: 8238669: Long.divideUnsigned is extremely slow for certain values (Needs to be Intrinsic) [v2]

2020-10-14 Thread Raffaello Giulietti
On Thu, 24 Sep 2020 15:33:01 GMT, Raffaello Giulietti wrote: >> @shipilev I agree, but that's the title chosen by the reporter of the JBS >> issue. Not sure I can edit it without >> impacting bots and tools. > > Hello > > this is a gentle reminder that this issue still needs a more formal revi

Re: RFR: 8238669: Long.divideUnsigned is extremely slow for certain values (Needs to be Intrinsic) [v2]

2020-09-24 Thread Raffaello Giulietti
On Wed, 9 Sep 2020 07:38:38 GMT, Raffaello Giulietti wrote: >> Since this patch does not involve adding the intrinsic, maybe drop "(Needs >> to be intrinsic)" from the synopsis? > > @shipilev I agree, but that's the title chosen by the reporter of the JBS > issue. Not sure I can edit it withou

Re: RFR: 8238669: Long.divideUnsigned is extremely slow for certain values (Needs to be Intrinsic) [v2]

2020-09-09 Thread rgiulietti
On Wed, 9 Sep 2020 06:25:40 GMT, Aleksey Shipilev wrote: >> rgiulietti has updated the pull request incrementally with one additional >> commit since the last revision: >> >> 8238669: Long.divideUnsigned is extremely slow for certain values (Needs >> to be Intrinsic) >> >> Added helpful

Re: RFR: 8238669: Long.divideUnsigned is extremely slow for certain values (Needs to be Intrinsic) [v2]

2020-09-08 Thread Aleksey Shipilev
On Tue, 8 Sep 2020 22:05:13 GMT, rgiulietti wrote: >> This is a follow-up of the Mercurial-based workflow initiated on the >> core-lib-devs mailing list [0]. Not sure if this >> one is strictly necessary or if the patches sent on the list are sufficient. >> Anyway, I exploit this PR as a test

Re: RFR: 8238669: Long.divideUnsigned is extremely slow for certain values (Needs to be Intrinsic) [v2]

2020-09-08 Thread rgiulietti
On Tue, 8 Sep 2020 20:42:41 GMT, rgiulietti wrote: >> src/java.base/share/classes/java/lang/Long.java line 1697: >> >>> 1695: final long q = (dividend >>> 1) / divisor << 1; >>> 1696: final long r = dividend - q * divisor; >>> 1697: return r - (~(r - divisor)

Re: RFR: 8238669: Long.divideUnsigned is extremely slow for certain values (Needs to be Intrinsic) [v2]

2020-09-08 Thread rgiulietti
> This is a follow-up of the Mercurial-based workflow initiated on the > core-lib-devs mailing list [0]. Not sure if this > one is strictly necessary or if the patches sent on the list are sufficient. > Anyway, I exploit this PR as a test ;-) > [0] > https://mail.openjdk.java.net/pipermail/core-

Re: RFR: 8238669: Long.divideUnsigned is extremely slow for certain values (Needs to be Intrinsic)

2020-09-08 Thread rgiulietti
On Tue, 8 Sep 2020 20:30:36 GMT, Éamonn McManus wrote: >> This is a follow-up of the Mercurial-based workflow initiated on the >> core-lib-devs mailing list [0]. Not sure if this >> one is strictly necessary or if the patches sent on the list are sufficient. >> Anyway, I exploit this PR as a t

Re: RFR: 8238669: Long.divideUnsigned is extremely slow for certain values (Needs to be Intrinsic)

2020-09-08 Thread Éamonn McManus
On Sun, 6 Sep 2020 15:25:10 GMT, rgiulietti wrote: > This is a follow-up of the Mercurial-based workflow initiated on the > core-lib-devs mailing list [0]. Not sure if this > one is strictly necessary or if the patches sent on the list are sufficient. > Anyway, I exploit this PR as a test ;-)

Re: RFR: 8238669: Long.divideUnsigned is extremely slow for certain values (Needs to be Intrinsic)

2020-09-08 Thread Éamonn McManus
On Sun, 6 Sep 2020 15:25:10 GMT, rgiulietti wrote: > This is a follow-up of the Mercurial-based workflow initiated on the > core-lib-devs mailing list [0]. Not sure if this > one is strictly necessary or if the patches sent on the list are sufficient. > Anyway, I exploit this PR as a test ;-)

RFR: 8238669: Long.divideUnsigned is extremely slow for certain values (Needs to be Intrinsic)

2020-09-07 Thread rgiulietti
This is a follow-up of the Mercurial-based workflow initiated on the core-lib-devs mailing list [0]. Not sure if this one is strictly necessary or if the patches sent on the list are sufficient. Anyway, I exploit this PR as a test ;-) [0] https://mail.openjdk.java.net/pipermail/core-libs-dev/20

Re: RFR: 8238669: Long.divideUnsigned is extremely slow for certain values (Needs to be Intrinsic)

2020-09-06 Thread Raffaello Giulietti
Hello, FYI I just opened a PR on GitHub for this RFR. Greetings Raffaello On 2020-09-03 00:44, Brian Burkhalter wrote: Good move. ;-) Brian On Sep 2, 2020, at 2:26 PM, Raffaello Giulietti mailto:raffaello.giulie...@gmail.com>> wrote: will do in the next days, hopefully before the trans

Re: RFR: 8238669: Long.divideUnsigned is extremely slow for certain values (Needs to be Intrinsic)

2020-09-03 Thread Raffaello Giulietti
Hi Joe, I modified the values in method testDivideAndRemainder(), without touching the logic. The values are odd and even dividends and divisors around 0, 2^31, 2^32, 2^33, 2^63 and 2^64. Is this OK? Greetings Raffaello On 2020-09-02 23:26, Raffaello Giulietti wrote: will do in the ne

Re: RFR: 8238669: Long.divideUnsigned is extremely slow for certain values (Needs to be Intrinsic)

2020-09-03 Thread Raffaello Giulietti
Hi Brian, setting up µ-benchmarks to get meaningful results on code that has execution paths with quite different shapes, like the current and the patched one, requires some care. I chose to exercise all paths at each iteration rather than to rely on a high iteration count. Without real worl

Re: RFR: 8238669: Long.divideUnsigned is extremely slow for certain values (Needs to be Intrinsic)

2020-09-02 Thread Brian Burkhalter
Good move. ;-) Brian > On Sep 2, 2020, at 2:26 PM, Raffaello Giulietti > wrote: > > will do in the next days, hopefully before the transition to Skara.

Re: RFR: 8238669: Long.divideUnsigned is extremely slow for certain values (Needs to be Intrinsic)

2020-09-02 Thread Raffaello Giulietti
Hi Joe, will do in the next days, hopefully before the transition to Skara. I'll also add JMH results. Greetings Raffaello On 2020-09-02 21:17, Joe Darcy wrote: Hello, I also suggest taking a look at the existing regression tests in     test/jdk/java/lang/Long/Unsigned.java to see if mo

Re: RFR: 8238669: Long.divideUnsigned is extremely slow for certain values (Needs to be Intrinsic)

2020-09-02 Thread Joe Darcy
Hello, I also suggest taking a look at the existing regression tests in     test/jdk/java/lang/Long/Unsigned.java to see if more cases should be added with the new algorithm. Potentially, the existing algorithm could retire to serve as a reference in the regression tests. Thanks, -Joe On

Re: RFR: 8238669: Long.divideUnsigned is extremely slow for certain values (Needs to be Intrinsic)

2020-09-02 Thread Raffaello Giulietti
Hi Brian, thanks for taking a look. I didn't write JMH benchmarks. Greetings Raffaello On 2020-09-02 16:25, Brian Burkhalter wrote: Hi Raffaello, I can take a look. Did you write any (JMH?) microbenchmarks? Thanks, Brian On Sep 2, 2020, at 5:52 AM, Raffaello Giulietti mailto:raffaello

Re: RFR: 8238669: Long.divideUnsigned is extremely slow for certain values (Needs to be Intrinsic)

2020-09-02 Thread Brian Burkhalter
Hi Raffaello, I can take a look. Did you write any (JMH?) microbenchmarks? Thanks, Brian > On Sep 2, 2020, at 5:52 AM, Raffaello Giulietti > wrote: > > here's a patch for [1], which is currently unassigned. Anybody willing to > sponsor it? > > The fix is based on "Hacker's Delight" (2nd ed

RFR: 8238669: Long.divideUnsigned is extremely slow for certain values (Needs to be Intrinsic)

2020-09-02 Thread Raffaello Giulietti
Hi, here's a patch for [1], which is currently unassigned. Anybody willing to sponsor it? The fix is based on "Hacker's Delight" (2nd ed), section 9.3 and makes use of longs only, no BigInteger, no garbage to collect. It is faster and "greener" than the current code. Contrary to the dramat