X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Recipient: djgpp AT delorie DOT com Message-ID: <4B2E7C60.2000600@iki.fi> Date: Sun, 20 Dec 2009 21:34:56 +0200 From: Andris Pavenis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; fi; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: Re: ANNOUNCE: DJGPP port of GMP-4.3.1 References: <200912171904 DOT nBHJ42qV008905 AT delorie DOT com> <6d1f3dc2-9a0c-4a2b-9b23-3b746c8d8700 AT v30g2000yqm DOT googlegroups DOT com> In-Reply-To: <6d1f3dc2-9a0c-4a2b-9b23-3b746c8d8700@v30g2000yqm.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com 20.12.2009 3:59, Rugxulo kirjoitti: > Hi, > > On Dec 17, 12:56 pm, Andris Pavenis wrote: > >> This is announcement of DJGPP port of GMP-4.3.1 >> >> GNU MP is a portable library written in C for arbitrary precision >> arithmetic on integers, rational numbers, and floating-point numbers. >> >> See http://gmplib.org/ for more details. >> > Dumb question, but why don't they make "--enable-fat" the default for > x86? I just built it, and it's a little larger, but it should > (ideally) be much faster, esp. for time-intensive things that use it > (e.g. GCC) since it checks at runtime what cpu-specific code to run. > > (your compile for /beta/): > -rw-a-- 3.0 fat 517550 b- defX 09-Dec-13 18:23 lib/libgmp.a > -rw-a-- 3.0 fat 22976 b- defX 09-Dec-13 18:23 lib/libgmpxx.a > -rw-a-- 3.0 fat 247714 b- defX 09-Dec-13 18:23 lib/libmp.a > > (my compile using /beta/): > 12/19/2009 06:50 PM 651,238 libgmp.a > 12/19/2009 06:50 PM 23,300 libgmpxx.a > 12/19/2009 06:51 PM 377,556 libmp.a > > http://rapidshare.com/files/323273044/gmp431b-beta-fat.zip.html > MD5: C961D95121DCCC8A76A243A0F609798C > > Well, did some tests (DJGPP v204pre only) using gmp-chudnovski.c (http://gmplib.org/pi-with-gmp.html). In both cases the task was to compute pi with 100000000 digits. 1) the configure option --enable-fat is added: D:\DJDEV\gmp\test>gmp-chudnovsky.exe 100000000 #terms=7051366, depth=24 sieve time = 1.483 .................................................. bs time = 660.055 gcd time = 0.000 div time = 55.000 sqrt time = 29.615 mul time = 21.264 total time = 767.582 P size=145605885 digits (1.456059) Q size=145605879 digits (1.456059) 2) the library from earlier build (no --enable-fat) D:\DJDEV\gmp\test>gmp-chudnovsky.exe 100000000 #terms=7051366, depth=24 sieve time = 1.483 .................................................. bs time = 925.659 gcd time = 0.000 div time = 74.011 sqrt time = 43.407 mul time = 28.571 total time = 1073.296 P size=145605885 digits (1.456059) Q size=145605879 digits (1.456059) As one can see, there is some improvement when --enable-fat has been specified. I do not believe that compilation speed of GCC is noticeably dependant on optimization level of GMP. As far as I understand GMP and MPFR is being using for propagating constants (if one specifies some constant expression, GCC tries to calculate value in compile time instead of genarating code for evaluation this expression). I guess that the number of such constant expressions is usually too small to cause any noticable increase of compilation time dues to non-optimality of GMP. Andris