Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-05-13 Thread Alan Eliasen
On 05/10/2013 03:19 PM, Brian Burkhalter wrote: On May 9, 2013, at 5:28 PM, Brian Burkhalter wrote: I just went ahead and filed 8014319 and 8014320 for phases 3 and 4, respectively. They will show up onhttp://bugs.sun.com/bugdatabase after some unspecified delay, probably about a day.

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-05-13 Thread Brian Burkhalter
On May 13, 2013, at 4:26 AM, Alan Eliasen wrote: Another minor note is that you might want to correct reminder to remainder in MutableBigInteger.java . I can revise the patches if you want. Thanks, Alan, I will take care of it. Brian

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-05-13 Thread Brian Burkhalter
On May 11, 2013, at 8:35 PM, Alan Eliasen wrote: On 05/09/2013 03:02 PM, Brian Burkhalter wrote: First you have: /** * The threshold value for using 3-way Toom-Cook multiplication. * If the number of ints in both mag arrays are greater than this number, * then Toom-Cook

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-05-13 Thread Brian Burkhalter
On May 13, 2013, at 11:57 AM, Brian Burkhalter wrote: On May 11, 2013, at 8:35 PM, Alan Eliasen wrote: On 05/09/2013 03:02 PM, Brian Burkhalter wrote: First you have: /** * The threshold value for using 3-way Toom-Cook multiplication. * If the number of ints in both mag arrays are

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-05-12 Thread Tim Buktu
On 10.05.2013 23:19, Brian Burkhalter wrote: Indeed these showed up: Phase 3: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8014319 Phase 4: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8014320 Brian Excellent, thanks!

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-05-11 Thread Alan Eliasen
On 05/09/2013 03:02 PM, Brian Burkhalter wrote: First you have: /** * The threshold value for using 3-way Toom-Cook multiplication. * If the number of ints in both mag arrays are greater than this number, * then Toom-Cook multiplication will be used. This value is found

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-05-10 Thread Brian Burkhalter
On May 9, 2013, at 5:28 PM, Brian Burkhalter wrote: I just went ahead and filed 8014319 and 8014320 for phases 3 and 4, respectively. They will show up onhttp://bugs.sun.com/bugdatabase after some unspecified delay, probably about a day. Verbiage may be updated as needed. Indeed these

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-05-09 Thread Alan Eliasen
On 05/07/2013 12:53 PM, Brian Burkhalter wrote: To recapitulate in one place, I think we agree on the following sequence: Phase 1: Faster multiplication and exponentiation of large integers * Karatsuba and Toom-Cook multiplication and squaring; revised pow() function. *

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-05-09 Thread Brian Burkhalter
On May 9, 2013, at 12:11 AM, Alan Eliasen wrote: Phase 1: Faster multiplication and exponentiation of large integers Phase 2: Faster string conversion of large integers Phase 3: Faster division of large integers Phase 4: Faster multiplication and division of very large integers Okay,

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-05-09 Thread Brian Burkhalter
Hi Max, On May 9, 2013, at 2:45 AM, Weijun Wang wrote: Out of curiosity (my major was math back in university), I take a look at BigInteger.java.phase1: All useful comments are welcome, for whatever reason! First you have: /** * The threshold value for using 3-way Toom-Cook

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-05-09 Thread Brian Burkhalter
On May 9, 2013, at 10:44 AM, Brian Burkhalter wrote: Tim and Brian, you might decide amongst yourselves who wants to file the issues for phases 3 and 4. I don't know if Brian has any magical powers to make the issues skip the QA process. Indeed if I file them it will streamline things. I

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-05-07 Thread Alan Eliasen
On May 4, 2013, at 5:13 AM, Alan Eliasen wrote: If you're feeling overwhelmed by the magnitude of the changes to BigInteger, I would very strongly suggest that you review it in stages. This e-mail proposes stages for the review of this patch. On 05/06/2013 02:47 PM, Brian Burkhalter wrote:

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-05-07 Thread Brian Burkhalter
Alan, On May 7, 2013, at 2:33 AM, Alan Eliasen wrote: My rationale for attempting a larger review was that if these new changes were not examined now, then they will likely miss the JDK 8 train altogether. On the other hand if time were to run out on a large review then there would be a risk

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-05-06 Thread Brian Burkhalter
Hi Alan, Thank you for the detailed, thoughtful message. On May 4, 2013, at 5:13 AM, Alan Eliasen wrote: If you're feeling overwhelmed by the magnitude of the changes to BigInteger, I would very strongly suggest that you review it in stages. This e-mail proposes stages for the review of

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-05-06 Thread Tim Buktu
Replying to myself: I will run the latest version of BigIntegerTest (which tests the above mentioned numbers around powers of two) for a day or so and report back. The test ran successfully. Tim

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-05-06 Thread Tim Buktu
Hi Brian, On 06.05.2013 22:47, Brian Burkhalter wrote: Also helpful to the process would be to have (four) staged patches available. I could take on this task as well, i.e., derive patches from the code provided thus far, but it might be safer if those more intimately familiar with the code

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-05-06 Thread Brian Burkhalter
On May 6, 2013, at 5:19 PM, Tim Buktu wrote: Replying to myself: I will run the latest version of BigIntegerTest (which tests the above mentioned numbers around powers of two) for a day or so and report back. The test ran successfully. Thanks for the update! Brian

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-05-06 Thread Brian Burkhalter
Hi Tim, On May 6, 2013, at 5:16 PM, Tim Buktu wrote: If I am not mistaken, the patch for Step 1 less the pow() improvements is this one: https://gist.github.com/tbuktu/1576025. For the time being I will start to look at this patch. Note that it also includes Burnikel-Ziegler. I put it in

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-05-04 Thread Alan Eliasen
On 05/02/2013 06:37 PM, Brian Burkhalter wrote: On May 2, 2013, at 5:02 AM, Alan Bateman wrote: On 02/05/2013 02:34, Tim Buktu wrote: : Alan is working on an improved BigInteger.toString() that should be dramatically faster for large numbers. What's the deadline for getting this in?

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-05-04 Thread Tim Buktu
On 05/04/2013 2:13 PM, Alan Eliasen wrote: My multiplication tests were written to test general multiplication, but also to very strongly test around the regions at which Karatsuba and Toom-Cook have edge cases. Since I don't know the Schönhage-Strassen algorithms, I don't know where they

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-05-02 Thread Alan Bateman
On 02/05/2013 02:34, Tim Buktu wrote: : Alan is working on an improved BigInteger.toString() that should be dramatically faster for large numbers. What's the deadline for getting this in? Thanks, Tim Here's the latest milestone dates: http://openjdk.java.net/projects/jdk8/milestones Given

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-05-02 Thread Brian Burkhalter
On May 2, 2013, at 5:02 AM, Alan Bateman wrote: On 02/05/2013 02:34, Tim Buktu wrote: : Alan is working on an improved BigInteger.toString() that should be dramatically faster for large numbers. What's the deadline for getting this in? Thanks, Tim Here's the latest milestone dates:

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-05-01 Thread Tim Buktu
Hi Brian, On 04/30/2013 01:40 AM, Brian Burkhalter wrote: To answer my own question, there are apparently about 1,000 more lines. It looks to me as if they are, i.e., the only changes versus the JDK8 repo are those intended for this patch. Yes and yes :) I just checked in a bug fix to

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-04-29 Thread Brian Burkhalter
Hi Tim, On Apr 28, 2013, at 4:31 PM, Tim Buktu wrote: thanks for the update. You're welcome. This patch differs from the code inhttps://github.com/tbuktu/bigint.git. Notably I observed that Schonhage-Strassen multiplication and Barrett division are not present. Is this intentional and if

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-04-29 Thread Brian Burkhalter
On Apr 29, 2013, at 11:00 AM, Brian Burkhalter wrote: How much additional code is there for these two algorithms? To answer my own question, there are apparently about 1,000 more lines. Unless it is some daunting amount, then if you think that the code is of sufficient quality, my opinion

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-04-25 Thread Brian Burkhalter
Hello, We are at long last soon to commence our long overdue effort to integrate this important submission. To this end I have a couple of questions and a comment below. Thanks, Brian On Mar 10, 2013, at 1:39 PM, Tim Buktu wrote: I have updated the patch. It now contains Alan Eliasen's

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-03-11 Thread Brian Burkhalter
Hi Tim, On Mar 10, 2013, at 1:39 PM, Tim Buktu wrote: I have updated the patch. It now contains Alan Eliasen's fast square() and pow() implementations. Special characters have been replaced with ASCII ones. Also included is a patched MutableBigInteger which uses the fast division

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-03-10 Thread Tim Buktu
Hi, I have updated the patch. It now contains Alan Eliasen's fast square() and pow() implementations. Special characters have been replaced with ASCII ones. Also included is a patched MutableBigInteger which uses the fast division algorithm in BigInteger, and a patched BigDecimal which uses the

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-03-05 Thread Brian Burkhalter
Hi Alan, On Mar 4, 2013, at 11:40 PM, Alan Eliasen wrote: There are issues filed about the inefficient algorithms used in toString and pow: 4641897: BigInteger.toString() algorithm slow for large numbers http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4641897 4646474:

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-03-04 Thread Brian Burkhalter
Probably a good idea. But seriously this patch is #5 in my queue. We do intend to get to it this spring. Brian On Mar 2, 2013, at 4:41 AM, Tim Buktu wrote: It's been over a year since my original patch, and it's been over 3 years since Alan posted his patch. I think I'll stop holding my

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-03-04 Thread Alan Eliasen
On 03/04/2013 11:04 AM, Brian Burkhalter wrote: Probably a good idea. But seriously this patch is #5 in my queue. We do intend to get to it this spring. Brian On Mar 2, 2013, at 4:41 AM, Tim Buktu wrote: It's been over a year since my original patch, and it's been over 3 years since

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-03-04 Thread Brian Burkhalter
Hi Alan, Thanks for the history: I was not myself aware of all that and it is good to know. Brian On Mar 4, 2013, at 1:44 PM, Alan Eliasen wrote: That's good to hear. By the way, in case you didn't know the history of this bugfix, the leading researcher in the world in Toom-Cook and

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-03-04 Thread Dr Heinz M. Kabutz
Whilst we're at it, could we also add an option, perhaps via environment variable, to parallelize Karatsuba and other calculations? Here's an article I wrote about the inefficiencies of BigInteger and working out large numbers: http://www.javaspecialists.eu/archive/Issue201.html Heinz On

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-03-04 Thread Alan Eliasen
Alan Eliasen wrote: Brian, as you may also not know, I have further patches to drastically improve the toString behavior of BigInteger using Schoenhage-Strassen recursive decomposition. This makes toString orders of magnitude faster for large numbers and will likely improve the

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-01-03 Thread Brian Burkhalter
Subject: Review Request: BigInteger patch for efficient multiplication and division (#4837946) To: core-libs-dev@openjdk.java.net Message-ID: blu0-smtp2745f8aa2a40c750c8b0113c6...@phx.gbl Content-Type: text/plain; charset=ISO-8859-15 Hello, I updated my patch that speeds up

Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2012-12-29 Thread Tim Buktu
Hello, I updated my patch that speeds up multiplication and division of large BigIntegers. The changes vs. the older patch were trivial. BigInteger.java: https://gist.github.com/1576025 Diff against current BigInteger: https://gist.github.com/1576016 The patch to the unit test still applies.