Clojure

BigInt math is slow when values of a BigInt are small enough to actually be treated as Longs

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: Release 1.3
  • Fix Version/s: Release 1.3
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code
  • Approval:
    Screened

Description

When doing math ops on a BigInt, It should default to treating smaller values of BigInts as Longs when possible to improve performance, and fall through to the actual BigInteger math when necessary.

  1. 0824_faster_bigint_ops.patch
    12/Aug/11 12:40 PM
    4 kB
    Aaron Bedra
  2. 0824-sans-inc-dec.patch
    23/Aug/11 6:12 PM
    5 kB
    Stuart Halloway
  3. bigint.patch
    06/Aug/11 9:34 AM
    4 kB
    Aaron Bedra

Activity

Hide
Aaron Bedra added a comment -

This is a first attempt at this. I noticed some nice performance improvements. My question is around what and how much to test this. There are no tests in this patch but I would be happy to add some if they are necessary.

Show
Aaron Bedra added a comment - This is a first attempt at this. I noticed some nice performance improvements. My question is around what and how much to test this. There are no tests in this patch but I would be happy to add some if they are necessary.
Hide
Aaron Bedra added a comment -

Ok, new patch. This one now passes all of the math tests in the test.generative examples

Show
Aaron Bedra added a comment - Ok, new patch. This one now passes all of the math tests in the test.generative examples
Hide
Stuart Halloway added a comment -

0824-sans-inc-dec is good. Same as Aaron's second patch, but removes BigInt inc and dec. They were left over from code that had them wired to Numbers.java, where they weren't any faster.

Show
Stuart Halloway added a comment - 0824-sans-inc-dec is good. Same as Aaron's second patch, but removes BigInt inc and dec. They were left over from code that had them wired to Numbers.java, where they weren't any faster.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: