This is a ruby implemetation.
Faster then mri 2.0; no big gain for jruby.
Jruby is 10x slower then mri 2.0 in my test
(jruby 1.7.8 (1.9.3p392) 2013-11-14 0ce429e on Java HotSpot(TM) 64-Bit Server VM 1.7.0_45-b18 [darwin-x86_64])
@giuan Your implementation is intriguing! It does indeed appear to be quite a bit faster than the Java BigInteger algorithm. I have not been able to confirm that it is 100% compatible, but I will explore that a bit now.
@headius Not yet. I've been fettered by my newness to the ecosystem (e.g. not knowing what tools are available to debug or inspect what's going on). I'm hoping to look at this again this weekend, but again, if anybody wants to leapfrog me on this, feel free. I'm not going to come back and say "hey! I was working on that!" :-)
This was fixed by #3211 above. We are still slower than MRI but many times faster than we were (on both 1.7.x and 9.x). Perhaps we can improve further but this is good enough to declare victory for today.
JRuby currently uses Java's BigInteger to handle String#to_i when it might need a Bignum. However, this algorithm is quite a bit slower than the one in MRI 2.1.
I had a quick look at the algorithm and I don't think it would be hard to mimic.
The text was updated successfully, but these errors were encountered: