|
i'm trying to make a non-poo poo version of biginteger and bigdecimal for scala. so far it seems to be going well though i've only got bigint partially implemented. i've got about a 5-30% speedup compared to original, but I haven't tested what happens when i start using the algorithms in https://github.com/tbuktu/bigint, hoping for some real massive performance increases.
|
# ¿ Aug 12, 2013 13:42 |
|
|
# ¿ Apr 26, 2024 06:19 |
|
Cold on a Cob posted:i thought scala compiled down to bytecode, shouldn't it already have this stuff? i don't know diddly about scala though obviously, so i guess not. it has java's biginteger, which is a pile of crap. if you look at the benchmarks game, the scala and java versions using biginteger for calculating digits of pi are around 6x slower than the same bench using libgmp. Part of that is because biginteger uses long multiplication in all cases and never attempts to use any of the algorithms that are good for larger numbers like toom-cook. you can see the end result of adding these algorithms to biginteger on the github page i linked. my version is a scala value class that uses an array of longs as the underlying storage for the type. i haven't got any of the faster multiplication algorithms added yet, but my version has a general 5-30% speedup for long multiplication and a 30% speedup for addition and subtraction operations
|
# ¿ Aug 12, 2013 14:18 |
|
heh
|
# ¿ Aug 12, 2013 18:34 |