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

BigInteger division algorithm selection heuristic is incorrect

XMLWordPrintable

    • b120
    • Not verified

        Currently Burnikel-Ziegler division is selected if

        (dividend.length < BURNIKEL_ZIEGLER_THRESHOLD || divisor.length < BURNIKEL_ZIEGLER_THRESHOLD)

        is FALSE. This causes significant performance regression (up to about 100%) for cases where dividend.length - divisor.length < OFFSET where 0 < OFFSET <= 2*BURNIKEL_ZIEGLER_THRESHOLD. A better algorithm selection heuristic is to select B-Z division if

        (divisor.length < BURNIKEL_ZIEGLER_THRESHOLD || dividend.length - divisor.length < BURNIKEL_ZIEGLER_OFFSET)

        is FALSE, i.e., to require that the int-length of the dividend exceed that of the divisor by a given minimum value.

              bpb Brian Burkhalter
              bpb Brian Burkhalter
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: