GMP vs NTL

jojo 29 jojo29118 at hotmail.com
Tue Jan 25 14:45:39 CET 2005


Hi,

I'm french (I live in Lyon) and english is not my native language. In my 
mind, "fastless" meaned "slower", "less fast than".

Delta Trinity, do you confirm that for "prime functions" 
(mpz_probab_prime_p, etc.) GMP is the fastest? And for multiplications? 
power (a^x by example)?

... I've tested the time that GMP and NTL need to realize ten iterations of 
the "Miller-Rabin primality test". GMP needs 4.8 seconds and NTL needs 48 
seconds! So, ten times more!! If you speak a little french, you can have a 
look on : 
http://forum.hardware.fr/forum2.php?config=hardwarefr.inc&post=63195&cat=10&cache=&sondage=0&owntopic=0&p=1&trash=0&subcat=.

Thanks for your help to all! (and don't hesitate to ask if you don't 
understand what i mean...)

JOjo


>From: gmp-discuss-request at swox.com Reply-To: gmp-discuss at swox.com To: 
>gmp-discuss at swox.com Subject: gmp-discuss Digest, Vol 17, Issue 6 Date: 
>Tue, 25 Jan 2005 12:00:02 +0100 (CET)
>
>Send gmp-discuss mailing list submissions to gmp-discuss at swox.com
>
>To subscribe or unsubscribe via the World Wide Web, visit 
>https://gmplib.org/mailman/listinfo/gmp-discuss or, via email, send a message 
>with subject or body 'help' to gmp-discuss-request at swox.com
>
>You can reach the person managing the list at gmp-discuss-owner at swox.com
>
>When replying, please edit your Subject line so it is more specific than 
>"Re: Contents of gmp-discuss digest..."
>
>
>Today's Topics:
>
>    1. RE: NTL vs GMP (delta trinity)
>
>
>----------------------------------------------------------------------
>
>Message: 1 Date: Mon, 24 Jan 2005 08:24:49 -0500 From: "delta trinity" 
><deltatrinity at hotmail.com> Subject: RE: NTL vs GMP To: gmp-discuss at swox.com 
>Message-ID: <BAY101-F27821E163650FE30FFD778D2850 at phx.gbl> Content-Type: 
>text/plain; charset="us-ascii"
>
>I used both GMP and NTL.
>
>Both libraries are arbitrary precision number library.  However, there are 
>strength and weekness to both.  It just depend on your application.
>
>GMP is designed to be fast.  It can be highly optimized for specific target 
>processor.  The core is written in assembly.  It contain some number theory 
>functions too, like Legendre, GCD, ...  If can work on 3 different kind of 
>numbers, which are integer, real numbers (float) and rationals (like 21/8). 
>Though, the weakness is in the availability (or rather, the lack of it) of 
>the real numbers functions, like cos, sin, log, ln, exp, ...  Though, there 
>is an extention, called mpfr, which can be built with GMP and support those 
>functions.  Mpfr is maintained by third-party.  GMP is written if 'c' 
>(appart from the assembly core).  It's interface is 'c'.  There are c++ 
>wrappers, but it's pretty just that, a wrapper.
>
>NTL is slower than GMP.  It's written solely in c++ (no assembly).  It's 
>interface is c++.  It is easier to use in a c++ environment.  Though, being 
>written in c++, it is much slower that GMP.  However, it can be compiled 
>using GMP as it's core, making it much faster.  Still, being c++, with all 
>the class initialization and destruction, it is still slower than pure GMP. 
>Where in GMP you can initialize variables globally, the one that you use 
>often, in critical loops, in NTL, there's a lot of internal code that 
>construct and destroy classes, making it slower.
>
>However, NTL is not built around absolute speed, but rather as a number 
>theory package (as the acronym imply).  It contain very powerfull number 
>theory functions, like polynomial arithmetics, arythmetics under modulo, 
>...   This is not available in GMP, which was not created with the idea of 
>being number theoric, but rather a very fast library.
>
>Both GMP and NTL are designed to be portable across multiple platforms.
>
>Hope this help.
>
> >From: "jojo 29" <jojo29118 at hotmail.com> >To: gmp-discuss at swox.com 
> >Subject: NTL vs GMP >Date: Sun, 23 Jan 2005 16:08:35 +0000 > 
> >_______________________________________________ >gmp-discuss mailing list 
> >gmp-discuss at swox.com >https://gmplib.org/mailman/listinfo/gmp-discuss
>
>-------------- next part -------------- An HTML attachment was scrubbed... 
>URL: 
>http://gmplib.org/list-archives/gmp-discuss/attachments/20050124/385c1279/text2-0001.html
>
>------------------------------
>
>_______________________________________________ gmp-discuss mailing list 
>gmp-discuss at swox.com https://gmplib.org/mailman/listinfo/gmp-discuss
>
>
>End of gmp-discuss Digest, Vol 17, Issue 6 
>******************************************




More information about the gmp-discuss mailing list