[gambit-list] Gambit versus Python+GMP: Timing for Chudnovskys' algorithm for pi
Bradley Lucier
lucier at math.purdue.edu
Fri Jun 7 20:15:51 EDT 2013
On 06/07/2013 06:02 PM, Mikael wrote:
>
> Was your Gambit pi-calculator compiled with (declare (not safe)) and
> any other related setting for optimizing speed, like increasing
> inlining, setting mostly generic and inlining standard and extended
> bindings, and executed with a minimum heap size of at least ~6MB?
The pi-calculator itself was interpreted; nearly all the work is done in
the Gambit runtime library. I suppose compiling it did speed it up a bit:
heine:~/programs/gambiteer/gambit> gsi chud1
Chudnovsky's algorithm using binary splitting in Gambit Scheme: digits
10, CPU time: 0..
Last 5 digits 26535.
Chudnovsky's algorithm using binary splitting in Gambit Scheme: digits
100, CPU time: 0..
Last 5 digits 70679.
Chudnovsky's algorithm using binary splitting in Gambit Scheme: digits
1000, CPU time: 0..
Last 5 digits 1989.
Chudnovsky's algorithm using binary splitting in Gambit Scheme: digits
10000, CPU time: .024.
Last 5 digits 75678.
Chudnovsky's algorithm using binary splitting in Gambit Scheme: digits
100000, CPU time: .43200000000000005.
Last 5 digits 24646.
Chudnovsky's algorithm using binary splitting in Gambit Scheme: digits
1000000, CPU time: 6.151999999999999.
Last 5 digits 58151.
Chudnovsky's algorithm using binary splitting in Gambit Scheme: digits
10000000, CPU time: 95.432.
>
> What's the scope of use of GMP in Python and in a hypothetical Gambit
> GMP support patch, only integer bignums?
I don't know.
>
>
> If you have any thought on this feel free to share.
>
>
> In all cases it's awesome that Gambit bundles its own bignum logics as
> by that Gambit is without any dependency requirement and thus makes
> Gambit completely portable and self-sustaining.
>
> Best regards,
> Mikael
>
> 2013/6/7 Bradley Lucier <lucier at math.purdue.edu
> <mailto:lucier at math.purdue.edu>>
>
>
> heine:~/programs/gambiteer/gambit> gsi chud1.scm
> Chudnovsky's algorithm using binary splitting in Gambit Scheme:
> digits 10, CPU time: 0..
> Last 5 digits 26535.
> Chudnovsky's algorithm using binary splitting in Gambit Scheme:
> digits 100, CPU time: 0..
> Last 5 digits 70679.
> Chudnovsky's algorithm using binary splitting in Gambit Scheme:
> digits 1000, CPU time: .004.
> Last 5 digits 1989.
> Chudnovsky's algorithm using binary splitting in Gambit Scheme:
> digits 10000, CPU time: .028.
> Last 5 digits 75678.
> Chudnovsky's algorithm using binary splitting in Gambit Scheme:
> digits 100000, CPU time: .472.
> Last 5 digits 24646.
> Chudnovsky's algorithm using binary splitting in Gambit Scheme:
> digits 1000000, CPU time: 6.448.
> Last 5 digits 58151.
> Chudnovsky's algorithm using binary splitting in Gambit Scheme:
> digits 10000000, CPU time: 98.612.
> Last 5 digits 55897.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20130607/152a7897/attachment.htm>
More information about the Gambit-list
mailing list