Bill Allombert on Wed, 05 Jun 2013 10:37:33 +0200

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Two trivial Qs, plz

On Wed, Jun 05, 2013 at 01:20:13AM -0700, zak seidov wrote:
> Q1. Is "print" command the slow one?
> I use running long (trivial) codes and
> sometimes print a lot of intermediate results (just to keep tracking the run).
> And it seems that this make program rather slower? Is it so?

Yes, input/output are slow by nature.

> Q2. I use both "old":
>                   GP/PARI CALCULATOR Version 2.3.4 (released)
>            i686 running cygwin (ix86/GMP-4.2.1 kernel) 32-bit version
>  compiled: Jul 12 2008, gcc-3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
>                 (readline v5.2 enabled, extended help available)
> and "new":
> GP/PARI CALCULATOR Version 2.5.3 (released)
>            i686 running mingw (ix86/GMP-5.0.1 kernel) 32-bit version
>                     compiled: Oct  3 2012, gcc-4.6.3 (GCC)
>                (readline not compiled in, extended help enabled)
> for long (trivial and boring) caculations (mainly with isprime() ).
> It seems that "new" version is slightly (not 2 times?) faster than the old one.
> Is it so?

Yes. In four year a lot of things have changed:
1) We improved the PARI code to be faster
2) GMP 5.0.1 is faster than GMP-4.2.1 especially on newer hardware that did not exist in 2008
3) the C compiler generates faster code.