Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4449911

REGRESSION: BigInteger.pow() painfully slow for large exponents (1.3 vs. 1.2.x)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 1.3.0
    • Fix Version/s: 1.4.0
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      beta2
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Description



      Name: krC82822 Date: 04/24/2001


      24 Apr 2001, eval1127@eng -- 1.3.x/1.4.x significantly slower
      than 1.2.x. See Comments section.
      ----------
      java version "1.3.0_02"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0_02)
      Java HotSpot(TM) Client VM (build 1.3.0_02, mixed mode)

      Sample program:

      import java.math.*;

      public class powtest
      {
          public static void main(String[] args)
          {
              long t1 = System.currentTimeMillis();

              BigInteger result = BigInteger.valueOf(10).pow(65536);

              System.out.println("runtime: " +
                 (System.currentTimeMillis()-t1)/1000.0 + " secs");
          }
      }

      System is: W2K Server SP1 AMD 550MHz

      Running against JDK 1.3.0_02 it takes about 65 seconds. If running against JDK
      1.2.2_006 it takes 0.5 seconds. Someone seems to have badly "over-optimized"
      this ...

      (Review ID: 123144)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              darcy Joe Darcy
              Reporter:
              kryansunw Kevin Ryan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: