Low efficiency of the mpf_out_str function !

Jason Lin chyn0610 at yahoo.com.tw
Fri Nov 9 14:21:01 CET 2007


> Jason,
> 
> Have you tried running the program with output NOT
> to stdout, but to
> file?

yes, both to stdout and to file are the same !


> I don't think the "conversion" from GMP-internal
> format to decimal takes
> *that* much time, but the actual formatted output
> on-screen (think
> "printf") might slow things down (especially for the
> number of characters
> you're outputting)...

1. I don't think either ! but I must emphasis that the
code was compiles on DJGPP 2.03 with GMP 4.1.2 .  I am
not sure if the GMP 4.2.2 have the same problem.

2. I don't think the bottleneck is the printf
function.
because the output screen ceased there for a long time
before the mess digits bursting out. It is the
mpf_out_str cause the ceasing ! (and the printf give
the bursting out digits almost in second)

3. Today I tried to compile the code with DEV-CPP
4.9.9.2 with GMP4.1.? (pre compiled. download from 
http://old.devpaks.org/list.php?category=Mathematics)
but the results is more worse, try to calculate more
than 500000 digits will get a runtime error.(general
protection error for OP code I think !)

4.The program Chudnovsky.c can be download from
http://gmplib.org/pi-with-gmp.html  
   Can some one give it a try ?? (with GMP 4.1.2)


Jason Lin




      _____________________________________________________________________________________
馬上體驗全新Yahoo!奇摩電子信箱2.0。 http://tw.mg0.mail.yahoo.com/dc/landing


More information about the gmp-discuss mailing list