Review Request: BigInteger patch for efficient multiplication and division (#4837946)
brian.burkhalter at oracle.com
Mon Mar 11 19:51:15 UTC 2013
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 algorithm in BigInteger, and a patched BigDecimal which uses
> the fast BigInteger.pow() method. Both changes speed up BigDecimal division.
> BigDecimal division is still much slower than BigInteger division
> (except BigDecimal.divideAndRound) because it calls doRound(),
> setScale(), and bigMultiplyPowerTen() which are pretty slow. Maybe these
> methods can be made more efficient.
> To view the four patched files (#4 is BigIntegerTest.java) on one page,
> go to
> https://gist.github.com/tbuktu/1576025 ,
> or get them individually at
That is awesome: thank you so much! We are working towards getting this in before long as indicated in other messages.
> Semi-related: I think there is a bug in
> jdk/test/java/math/BigInteger/CompareToTests.java and
> jdk/test/java/math/BigDecimal/CompareToTests.java. It prints failures
> (with or without my patches) but the overall test doesn't fail.
Thanks for the pointer: will check it out.
More information about the core-libs-dev