GMP «Arithmetic without limitations» GMPbench results


GMPbench results. We have run the benchmark on the highest-frequency machine of each type to which we have convenient access. Scaling to lower or higher frequencies should work well, since GMP mainly works off the caches.

The GMPbench suite is available for download. To run the benchmarks, you also need to compile gexpr.c and put it somewhere in your path.

GMP exercises a particular set of processor capabilities, widening integer multiplication being the most important one. Processors with poor integer multiply support get worse scores on GMPbench than on other benchmarks.

GMPbench 0.2 isn't a perfect benchmarks suite for GMP, but it is much better than GMPbench 0.1.

GMPbench 0.1 measures multiplication with same-size operands, and division, and then RSA encryption. That's it. GMP typically performs a whole lot more operations which are not measured at all. Furthermore, the RSA figures weighed too much in the score computation.

GMPbench 0.2 adds squaring, multiplication of different-size operands, more variants of division, gcd and gcdext, all in the "base" hierarchy, and pi computation in the "app" hierarchy.

The additional benchmarks of GMPbench 0.2 aren't totally fair to older GMP versions; we added measurements of things we thought were important, and then used these to drive generic improvements of GMP 4.3. We sort of tuned for the benchmark, but since we chose the benchmarks to make sense, it isn't as silly as such an exercise would usually be.

GMP repo [measured at different times, therefore unfair] GMPbench 0.2 results


CPU
freq
MHz
A
B
I
Compiler/Compilation flags
base
multiply  divide gcd gcdext
app
rsa       pi
GMP-
bench
Score/
GHz
Core i7-4790 (Haswell 8MB L3) 4000 64 "gcc 4.5.3" -O2 -m64 -mtune=core2 66464 59923 11336 7487 8294 62.0 4882 1220
Xeon E3-1275v2 (Ivy Bridge 8MB L3) 3500 64 "gcc 4.7.2" -O2 -m64 -mtune=corei7 50751 48391 8883 5735 6603 48.9 3842 1098
Core i5 2500 (Sandy Bridge 6MB L3) 3300 64 "gcc 4.2.1" -O2 -m64 -march=core2 44352 42056 7997 5419 5885 42.8 3403 1031
Phenom 1090T (K10 6MB L3) 3200 64 "gcc 4.2.1" -O2 -m64 -mtune=k8 40580 37878 6893 4539 5682 40.4 3133 979
AMD FX 8350 (Piledriver 8MB L3) 4000 64 "gcc 4.7.2" -O2 -m64 36801 36578 6094 3696 4634 37.7 2785 696
POWER7 / SMT-4 3550 64 "gcc 4.7.2" -O3 -mtune=power7 33084 30134 5077 3684 3846 34.1 2427 684
AMD FX 4100 (Bulldozer 8MB L3) 3600 64 "gcc 4.2.1" -O2 -m64 31450 30787 5558 3680 3945 32.4 2419 672
Core i7 920 (Nehalem) 2667 64 "gcc 4.7.2" -O2 -m64 -mtune=corei7 -march=corei7 27197 25613 4848 3053 3524 28.3 2095 785
Core 2 E6400 (Conroe) 2133 64 "gcc 4.2.1" -O2 -m64 20253 17825 3680 2327 2523 21.2 1534 720
AMD 5350 (Jaguar) 2050 64 "gcc 4.5.3" -O2 14367 17334 2940 2021 2097 17.1 1270 619
AMD E-350 (Bobcat) 1600 64 "gcc 4.5.3" -O2 11040 13079 2161 1528 1600 12.8 957 598
POWER6 3500 64 "xlc" -O2 -qarch=pwr6 10561 11401 2110 1292 1133 13.0 841 240
Arm Cortex-A15 1700 32 "gcc 4.6.3" -O2 -fomit-frame-pointer 7352 7453 1467 980 936 8.78 605 356
Athlon32 2083 32 "gcc 4.2.1" -O2 -fomit-frame-pointer 6005 6899 1461 957 641 8.16 514 247
Intel Atom 330 1600 64 "gcc 4.4.1" -O2 -m64 4592 5223 986 589 500 5.66 374 234
Arm Cortex-A9 1000 32 "gcc 4.4.5" -O2 -fomit-frame-pointer 3715 3575 773 514 495 3.38 288 288
z990 1200 64 "gcc 4.4.5" -O2 -fomit-frame-pointer 3037 3838 747 438 317 4.01 259 216
Alpha 21164 600 64 "gcc 3.4.6" -O2 1415 1789 383 217 167 1.85 126 210

(Note that these numbers come from a non-released version of GMP. While most results have increased wrt the numbers below, there are also one or two drops. We expect to address those before making the next major release.)



GMP 5.0.1 GMPbench 0.2 results


CPU
freq
MHz
A
B
I
Compiler/Compilation flags
base
multiply  divide gcd gcdext
app
rsa       pi
GMP
bench
Score/
GHz
Opteron/Athlon64 K10 6MB L3 3200 64 "gcc 4.3.3" -O2 -m64 -mtune=k8 40879 37617 6189 3918 5226 39.4 2985 933
Core i5 2500 (Sandy Bridge) 3300 64 "gcc 4.4.5" -O2 -m64 38560 37308 6357 4173 5173 38.1 2943 891
Core i7 920 (Nehalem) 2667 64 "gcc 4.2.1" -O2 -m64 25737 23708 4416 2904 3284 26.8 1962 735
Core 2 E6400 (Conroe) 2133 64 "gcc 4.2.1" -O2 -m64 19209 17351 3385 2097 2422 20.7 1466 687
PowerPC 970 ("G5") 2700 64 "gcc 4.0.1-5370" -O3 -m64 -mtune=970 12601 14658 2579 1464 1391 15 1013 375
Itanium 2 1300 64 "gcc 4.2.4" -O2 -m64 16290 11175 2336 1384 1207 16.1 980 735
VIA Nano 1600 64 "gcc 4.3.4" -O2 -m64 12202 10588 2379 1420 1703 12.4 950 594
Pentium 4 (Nocona) 3400 64 "gcc 4.2.1" -O2 -m64 11457 11914 2148 1357 1447 12.8 915 269
AMD Bobcat 1600 64 "gcc 4.2.1" -O2 11115 11533 2143 1331 1526 11.7 895 559
Pentium 4 (Northwood) 2600 32 "gcc 4.2.1" -O2 -fomit-frame-pointer -march=pentium4 5538 5280 1225 740 666 7.5 462 178
Intel Atom 330 1600 64 "gcc 4.4.1" -O2 -m64 4422 5174 896 502 498 5.6 362 226
UltraSPARC 3 1593 64 "gcc 3.4.4" -O2 -m64 4125 4168 926 547 392 5.7 330 207
Alpha 21264 500 64 "gcc 3.3.3" -O2 -mcpu=ev6 3492 3592 666 445 449 4.2 286 572


GMP 4.3.x GMPbench 0.2 results


CPU
freq
MHz
A
B
I
Compiler/Compilation flags
base
multiply  divide gcd gcdext
app
rsa       pi
GMP
bench
Score/
GHz
Opteron/Athlon64 K10 6MB L3 3200 64 "gcc 4.3.3" -O2 -m64 -mtune=k8 39826 24748 5953 3729 4956 37 2669 834
Core i7 920 (Nehalem) 2667 64 "gcc 4.2.1" -O2 -m64 23842 14217 4375 2782 3083 23 1683 631
Core 2 E6400 (Conroe) 2133 64 "gcc 4.2.1" -O2 -m64 17981 10656 3312 2035 2330 18 1276 598
PowerPC 970 ("G5") 2700 64 "gcc 4.0.1-5367" -O3 -m64 -mcpu=970 12364 9349 2412 1489 1577 14 946 350
Itanium 2 1300 64 "gcc 4.2.1" -O2 -m64 15578 7983 2260 1342 1294 14.6 909 699
Pentium 4 (Nocona) 3200 64 "gcc 4.2.1" -O2 -m64 10975 6968 1938 1315 1468 11.3 799 250
Pentium 4 (Northwood) 2600 32 "gcc 4.2.1" -O2 -fomit-frame-pointer -march=pentium4 5162 2874 1163 707 654 6.5 394 152
UltraSPARC 3 1593 64 "gcc 3.4.4" -O2 -m64 3733 2488 956 533 370 5.1 286 180
Alpha 21264 500 64 "gcc 3.3.3" -O2 -mcpu=ev6 3208 2277 654 446 447 3.8 256 512
Pentium MMX 233 32 "gcc 3.4.4" -O2 -fomit-frame-pointer 264 175 71 42 27 0.38 21 90

Notes:
  1. The last column, "Possible Score/GHz", is an estimate of what could be attained by implementing known optimisations to GMP for this processor.

GMP 4.3.x GMPbench 0.1 results


CPU
freq
MHz
A
B
I
Compiler/Compilation flags
base
multiply divide
app
rsa
GMPbench Score/
GHz
Opteron/Athlon64 K10 2300 64 "gcc 3.4.3" -O2 -m64 -mtune=k8 81633 42278 3606 14554 6328
Opteron/Athlon64 K8/K9 2200 64 "gcc 3.4.6" -O2 -m64 -mtune=k8 69279 40081 3232 13050 5932
Core 2 E6400 (65nm) 2133 64 "gcc 4.2.1" -O2 -m64 -mtune=k8 51519 24316 2314 9050 4249
Pentium 4 (Nocona) 3200 64 "gcc 3.4.4" -O3 -m64 -mtune=k8 31259 16412 1427 5685 1777
PowerPC 970 ("G5") 1600 64 "gcc 4.0.1 build 5367" -mcpu=970 -O3 22119 12198 916 3880 2425
Alpha 21264   64            
Athlon XP   32            
Pentium 4 Prescott   32            
Pentium 4 (Northwood) 2600 32 "gcc 3.4.6" -O2 -fomit-frame-pointer -march=pentium4 16133 6726 680 2661 1023
Pentium 3 / Pentium M   32            
Atom 1600 64 "gcc 4.2.1" -O3 -m64 -mtune=k8 12471 6940 457 2063 1289
UltraSPARC 3 1593 64   11066 5942 370 1732  
PowerPC 7447 ("G4")   32            
Alpha 21164A   64            

Notes:
  1. The clock frequencies for the above measures are not the same as for GMP 4.2, since we didn't have access to the same hardware. However, we have remeasured some of the 4.2 numbers and updated the table below.
  2. The last column, "Optimal", is an estimate of what could be attained by writing optimised assembly code for this processor.

GMP 4.2.x GMPbench 0.1 results


CPU
freq
MHz
A
B
I
Compiler/Compilation flags
base
multiply divide
app
rsa
GMPbench Score/
GHz
Opteron/Athlon64 K10 2300 64 "gcc 3.4.3" -O2 -m64 -mtune=k8 43473 23880 2178 8377 3642
Opteron/Athlon64 K8/K9 2200 64 "gcc 3.4.6" -O2 -m64 -mtune=k8 38362 21621 1979 7549 3431
Core 2 E6400 (65nm) 2133 64 "gcc 4.2.1" -O2 -m64 -mtune=k8 36902 20330 2092 7570 2523
PowerPC 970 ("G5") 2700 64 "gcc 4.0.1 build 5367" -mcpu=970 -fast 27740 16500 1409 5490 2033
Pentium 4 3200 64 "gcc 3.4.4" -O2 -m64 -mtune=k8 19425 10525 929 3645 1139
Alpha 21264 1000 64 "gcc 4.1.2" -O3 -mcpu=ev67 18703 11272 913 3641 3641
Itanium 2 1600 64 "gcc 4.1.1" -O3 -mtune=itanium2 19744 10340 799 3379 2112
Athlon XP 2083 32 "gcc 4.0.2" -O2 -fomit-frame-pointer 15682 7902 624 2636 1265
Pentium 4 Prescott 3000 32 "gcc 4.0.2" -O2 -fomit-frame-pointer -march=pentium4 15123 6189 675 2556  
Pentium 4 (Northwood) 2600 32 "gcc 3.4.6" -O2 -fomit-frame-pointer -march=pentium4 14111 5468 569 2236  
Pentium 3 / Pentium M 1862 32 "gcc 3.4.4" -O2 -fomit-frame-pointer 11381 5286 429 1824  
UltraSPARC 3 1593 64 "gcc 3.4.4" -O2 -mcpu=ultrasparc 10597 5349 368 1665  
HPPA 8800 800 64 "cc B.11.X.32509-32512.GP" +DD64 +O2 9466 3631 385 1503  
Atom 1600 64 "gcc 4.2.1" -O2 -m64 -mtune=k8 6737 4465 320 1325 828
PowerPC 7447 ("G4") 1420 32 "gcc 4.1.0" -O2 -mpowerpc -mcpu=7450 6080 3479 247 1066  
Alpha 21164A 600 64 "gcc 4.1.2" -O3 -mcpu=ev56 3964 2122 179 721  

GMP 4.1.x results


CPU
freq
MHz
A
B
I
Compiler/Compilation flags
base
multiply divide
app
rsa
GMPbench
Optimal
(see note)
Opteron/Athlon64 2400 64 "gcc 3.4.2" -O2 -mcpu=nocona -funroll-loops
(NB! no asm code)
27321 18280 1441 5675  
PowerPC 970 ("G5") 2500 64 "gcc 3.4" -O3 20324 12874 1110 4238  
Opteron/Athlon64 2400 32 "gcc 3.3.3" -O2 -fomit-frame-pointer
(NB! 32-bit only)
19127 9823 802 3316  
Alpha 21264 1000 64 "gcc 2.9-gnupro-99r1" -O2 16813 10706 782 3240  
Pentium 4 3200 64 "gcc 4.0.2" -O2 -m64 -mtune=k8
(NB! No asm code)
15613 9186 814 3122  
Itanium 2 1600 64 "gcc 3.4.3" -O2
(NB! Low-quality asm code)
17046 9027 749 3047  
Athlon XP 2083 32 "gcc 3.3.2" -O2 -fomit-frame-pointer 14076 7731 616 2535  
Pentium 4 (Northwood) 2800 32 "gcc 3.3.2" -O2 -fomit-frame-pointer -march=pentium4 13013 5770 586 2253  
Pentium 4 Prescott 3000 32 "gcc 3.3.2" -O2 -fomit-frame-pointer -march=pentium4 13348 5393 574 2206  
POWER 4 1100 64 "gcc 3.2.1" -O2 -maix64 -mpowerpc64 -mtune=power3 8951 5920 478 1863  
Pentium 3 / Pentium M 1862 32 "gcc 3.4.4" -O2 -fomit-frame-pointer 8125 4712 393 1560  
HPPA 8800 800 64 "cc B.11.11.30766" +DD64 +O2 9040 3724 362 1450  
UltraSPARC 3 1336 64 "gcc 3.4.4" -O2 -m64 -mptr64 -mcpu=v9 6111 3645 265 1119  
MIPS R14000 500 64 cc 7.3.0 5284 2819 241 964  
PowerPC 74x7 ("G4") 1000 32 "gcc 3.3.3" -O2 -mpowerpc 3453 2203 165 676  
POWER 3 475 64 "gcc 2.9-aix51-020209" -maix64 -mpowerpc64 -O2 3647 2259 157 671  
Alpha 21164A 600 64 "gcc 3.2.1" -O2 3514 2185 158 663  
VIA C3 Nehemiah 1000 32 "gcc 3.4.2" -O2 -fomit-frame-pointer -march=c3-2 2378 1314 111 442  
UltraSPARC 2i 400 64 "gcc 3.2.2" -O2 -mcpu=ultrasparc 1971 900 89 343  

Notes:

Please send comments about this page to gmp-discuss at gmplib.org
Copyright 2000-2011 Free Software Foundation
Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.