It might be easier to link to a standard open-source multi-precision
library that it would be to revise the one that's built into the Ruby
interpreters. I haven't benchmarked these against each other, but the
two I know about are GMP http://gmplib.org/ and CLN http://www.ginac.de/CLN/\. Both are GPL. GMP is available in just about
every Linux distro I know about; CLN may be a little harder to find,
but it's in Debian and Gentoo. I don't know about other platforms, but
at least GMP is "pure-enough" GNU that it should compile on Windows
and Macs and Solaris.
Ezra ... is this something Engine Yard could do for 1.8.6 / Rubinius?
I think the jRuby people are working on their Bignum performance too.
···
On Mon, Mar 16, 2009 at 4:23 PM, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
Hi,
In message "Re: BigNum optimizations" > on Tue, 17 Mar 2009 07:49:20 +0900, Artem Voroztsov <artem.voroztsov@gmail.com> writes:
In message "Re: BigNum optimizations" on Wed, 18 Mar 2009 04:11:34 +0900, "M. Edward (Ed) Borasky" <zznmeb@gmail.com> writes:
It might be easier to link to a standard open-source multi-precision
library that it would be to revise the one that's built into the Ruby
interpreters. I haven't benchmarked these against each other, but the
two I know about are GMP http://gmplib.org/ and CLN http://www.ginac.de/CLN/\. Both are GPL.
We cannot link pure GPLed library to Ruby for licensing issue. Last
time I checked none of these multi precision numeric libraries
satisfied our criteria (license, portability, etc). GMP (or CLN or
whatever) can be used via extension, and we are happy to offer help if
required.
Ezra ... is this something Engine Yard could do for 1.8.6 / Rubinius?
I think the jRuby people are working on their Bignum performance too.
We're mostly just wrapping the JDK's builtin BigInteger class, which is not known for its scorching performance. BigInteger.doubleValue actually passes the number through a a String and re-parses it (a contributor implemented a replacement, for obvious reasons). There are alternative libraries, but we have not merged them in to avoid bloating the size of JRuby's distribution.
Of course almost all of them can be called directly through our Java integration layer, so if people need the performance they can do that. Java 7 is supposed to include a number of performance improvements for BigInteger as well.
We would not decline a clean-room implementation of Bignum that uses the latest and greatest algorithms It would probably be easier in Java than in C.
>It might be easier to link to a standard open-source multi-precision
>library that it would be to revise the one that's built into the Ruby
>interpreters. I haven't benchmarked these against each other, but the
>two I know about are GMP http://gmplib.org/ and CLN
>http://www.ginac.de/CLN/\. Both are GPL.
We cannot link pure GPLed library to Ruby for licensing issue. Last
time I checked none of these multi precision numeric libraries
satisfied our criteria (license, portability, etc). GMP (or CLN or
whatever) can be used via extension, and we are happy to offer help if
required.
I just checked ... GMP is LGPL. Would that work?
···
On Tue, Mar 17, 2009 at 5:56 PM, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
In message "Re: BigNum optimizations" > on Wed, 18 Mar 2009 04:11:34 +0900, "M. Edward (Ed) Borasky" <zznmeb@gmail.com> writes:
In message "Re: BigNum optimizations" on Wed, 18 Mar 2009 10:01:07 +0900, "M. Edward (Ed) Borasky" <zznmeb@gmail.com> writes:
We cannot link pure GPLed library to Ruby for licensing issue. Last
time I checked none of these multi precision numeric libraries
satisfied our criteria (license, portability, etc). GMP (or CLN or
whatever) can be used via extension, and we are happy to offer help if
required.
I just checked ... GMP is LGPL. Would that work?
Well, it's not impossible (i.e. 1.8 regex was LGPL), but not ideal.
Some commercial Ruby users had to replace 1.8 regex by Oniguruma only
for a license issue. I don't want to see same situation for bignums.
On Wed, Mar 18, 2009 at 10:10:45AM +0900, Yukihiro Matsumoto wrote:
Hi,
In message "Re: BigNum optimizations" > on Wed, 18 Mar 2009 10:01:07 +0900, "M. Edward (Ed) Borasky" <zznmeb@gmail.com> writes:
>> We cannot link pure GPLed library to Ruby for licensing issue. ?Last
>> time I checked none of these multi precision numeric libraries
>> satisfied our criteria (license, portability, etc). ?GMP (or CLN or
>> whatever) can be used via extension, and we are happy to offer help if
>> required.
>
>I just checked ... GMP is LGPL. Would that work?
Well, it's not impossible (i.e. 1.8 regex was LGPL), but not ideal.
Some commercial Ruby users had to replace 1.8 regex by Oniguruma only
for a license issue. I don't want to see same situation for bignums.
Yeah ... the PostgreSQL community mostly uses BSD-style licenses
specifically because of the "chilling effect" of GPL on commercial
users. Actually, given that a lot of BigNum work came out of MIT, I'm
surprised there isn't an MIT-licensed BigNum library running around
somewhere. Let me dig around into what's in Sage (sagemath.org) and
what's in Python. This is a wheel we shouldn't have to re-invent or
even re-code.
···
On Tue, Mar 17, 2009 at 6:10 PM, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
>I just checked ... GMP is LGPL. Would that work?
Well, it's not impossible (i.e. 1.8 regex was LGPL), but not ideal.
Some commercial Ruby users had to replace 1.8 regex by Oniguruma only
for a license issue. I don't want to see same situation for bignums.