seanjensengrey / mosh-scheme

Automatically exported from code.google.com/p/mosh-scheme
Other
0 stars 0 forks source link

too much time to compute with bignum #148

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run:

(import (rnrs))
(define (B m e) (* m (expt 2 e)))
(write (B #x1 131072))(newline)

It takes significant more time to complete compared to other Schemes. 
Probably because you are using the mpz and mpq functions rather than go
directly for the limbs API in GMP.

Original issue reported on code.google.com by mrc....@gmail.com on 31 May 2010 at 7:56

GoogleCodeExporter commented 9 years ago
Hi.
I found GMP function mpz_pow_ui, and changed to use it.
Becomes much faster.

http://github.com/higepon/mosh/commit/68795464c53c6e95da9456e95beeb5b317ff6afb

Original comment by hige...@gmail.com on 1 Jun 2010 at 12:38