The point of this page, such that it is, is to provide some idea of how various pi programs perform on Linux. Basically, I shamelessly copied the format that Stuart Lyster used, and added a few more measurements. I really wouldn't have done this at all except that Stuart does all his testing in Windows, and he uses a P-IV. As I don't like Windows, and I think the P-IV doesn't show a lot of these programs in the proper light, I created this. It is still very much under construction however.

All the programs on this chart run on x86/Linux, either natively, or through Windows emulation. The test was performed on an HP Visualize X Class with dual 733MHZ P-III processors and 1024MB RAM. Programs which were compiled were built with Intel C/C++ 5.01 with optimization set to the default. Relative speed is number of times as fast as SuperPi.


3/17/02 Beautified the page and added Jorg Arndt's hfloat based pi calculator (I called it hfloatpi).

3/12/02 Another new program is out, Alan Pittman's Chudnovsky based program. It's quite fast, and is even faster than ahppi2.

2/22/02 A new program, which I'm calling gmp-chudnovsky, by Hanhong Xue, has appeared. It looks to be a good 30% faster than gmp-ramanujan, which is quite an improvement. Nice. Windows binaries should be out in a day or too. Quick note: Windows binaries of gmp-pi all crash when you try to print out more than ~140,000 digits (they'll calculate fine, but setting print output to 1 causes the crash), due to a bug in the dll. I've rebuilt the dll, but to no avail. I'm going to ask the GMP guys if they know what's wrong.

A special thanks to Stuart Lyster, who provided both the motivation and the model for the page. Also thanks very much to the authors of the programs below for bringing them to us. I particularly want to thank: Carey Bloodworth, Takuya Ooura (whose name I've been misspelling for the last year, it's Takuya, not Takuyo), and Mikko Tommila, who not only created great programs, but also gave the sources out for everyone to compile, copy or try out. Thanks again guys!

Program name Author Performance Relative Speed Max # digits Notes Download
QuickPi 2.0 Steve Pagliarulo 13.00 14.31 256m QuickPi 2.0 is a relative newcomer, but for less than 8m digits, it's faster than anything else. It is available for Windows, and no source is provided. Runs fine under Wine in Linux. binary: windows
Schnell_Pi 1.0 Dominique Delande 15.78 11.79 512m Schnell_Pi popped up last August as a bit of a surprise. It is the only Linux-only pi program, and no source is available. For more than 4m digits, it is the fastest program I've yet seen. Note that I do not approve of closed source Linux programs any more than closed source Windows ones. I hope that the source will be made available eventually. binary: x86/linux
PiFast 4.1 Xavier Gourdon 16.00 11.63 12000m PiFast was the first program available to beat pi_css5 convcincingly. It currently also has the record for the most digits calculated: some 12billion (12*10^12)! It is available for Windows only, but works under Wine. binary: windows
gmp-chudnovsky Hanhong Xue 20.29 9.17 32m gmp-chudnovsky is an open source pi program based upon the GNU MultiPrecision arithmetic package. Although it is not good for larger numbers of digits, it does demonstrate what can be done with GMP. source: source binary: windows or x86/linux
gmp-ramanujan Hanhong Xue 28.83 6.57 4m gmp-ramanujan is the precursor to gmp-chudnovsky. It fits right between gmp-gauss and gmp-chudnovsky in terms of speed source: source binary: windows or x86/linux
aptestlm Mikko Tommila 34.42 5.40 226m This program was intended as a test of the apfloat numerics package. However it is also an excellent open source pi program, and the only one I know of which is multithreaded, and so used both processors on the test machine. source: source binary: windows or x86/linux
pi_css5 Takuya Ooura 36.52 5.09 67m pi_css5 is my favorite program for calculating pi. It's fast, small and very portable, so it is the centerpiece of my computer benchmark tests. It was not intended for vast numbers of digits, but still scales pretty well. source: source binary: windows or x86/linux
pi agm fft Carey Bloodworth 41.28 4.51 8m (see below) pi agm was the first pi program I started playing with. While it has gotten larger and more complicated over the years, it is an excellent example of organization and programming. This version uses the fft-hartley for optimal speed, although it can use a large number of different ffts/ntts. source: source
chud14 Alan Pittman 55.39 3.36 32m chud14 is Alan Pittman's newest pi program based on the fftw fft package, and using the Chudnovsky formula. source: source
aptestl5 Mikko Tommila 60.11 3.09 226m This is the single processor version of the above program. While it is slower, it gives an interesting insight into how much benefit is gained from 2 processors over 1. source: source
pi agm ntt 2.3.1 Carey Bloodworth 66.03 2.82 1024m This version of pi agm was designed for longer runs, and was the first pi program to calculate 1billion digits on a PC. source: source
gmp-gauss Hanhong Xue 68.75 2.71 4m gmp-gauss is the counterpart of gmp-ramanujan using the gauss agm formula. Using GMP 4.0, I get about 25% better results than I did with GMP 3.1. source: source binary: windows or x86/linux
ahppi2 Alan Pittman 76.97 2.42 4m ahppi2 is Alan Pittman's pi program based on the fftw fft package. It a much faster and improved version of ahppi source: source
piologie Sebastian Wedeniwski 91.80 2.03 8m piologie is a Windows program to calculate pi, e, and lots more besides. binary: windows
hfloatpi Jorg Arndt 95.70 1.94 8m hfloatpi is a rather old, and somewhat complex pi program, although it can calculate much more than pi. While it does have source, I couldn't get it to build. source: source binary: x86/linux
SuperPi Yasumasa Kanada 186 1.00 32m SuperPi is an old Windows pi program, but it was the first capable of calculating 32 million digits, and was written by the same guy who calculating 68billion digits at the University of Tokyo in 1998 (not on a PC though) binary: x86/win or x86/linux

Please, if you see other fast pi programs out there, send them in, and I'll add them to the table. Note: I would appreciate if total runtime of the programs sent is less than SuperPi, as I'd like that to be the line between fast and not so fast programs.

Here is more complete table of pi timings made from the above programs. I organized them in order of speed, as best I could. Unfortunately, a number of them do not go up to 64meg of digits, so I my ordering scheme may not be accurate. I'm sure this would all look much better in graphic form, but 'til I find a good graphing program, that'll have to wait. Runs were performed on the same system as above. Number of digits is in megabytes (n*1048576) and data is number of seconds run took to complete.

Digits 131,072 262,144 524,288 1,048,576 2,097,152 4,194,304 8,388,608 16,777,216 33,554,432 67,108,864
Schnell_pi 1.0 1.33 3.08 7.05 15.78 36.40 80.86 189.95 428.38 983.43 2068.57
PiFast 4.1 1.20 3.00 7.15 16.00 41.14 87.89 195.62 445.96 1005.83 2275.85
QuickPi 2.0 0.85 2.14 5.33 13.00 31.38 79.81 198.52 495.27 1239.94 3540.06*
gmp-chudnovsky 1.20 3.11 8.03 20.29 51.65 130.44 na*
aptestlm 2.85 6.33 14.57 34.42 77.63 169.18 379.80 883.65 1890.64 4490.74
gmp-ramanujan 1.60 4.29 11.38 28.83 72.86 179.71 na*
pi_css5 2.44 6.56 15.59 36.52 82.74 186.17 408.46 891.90 1961.38 4304.14
pi-agm fft 2.3.1 2.66 6.80 16.59 41.28 102.16 232.40 513.72 na*
chud14 4.51 10.35 23.96 55.30 136.70 294.38 705.41 1590.58 3288.88 na*
aptestl5 5.50 11.81 27.04 60.11 132.94 276.69 620.85 1330.63 3455.21 7938.28
pi-agm ntt 2.3.1 5.79 13.03 29.46 66.03 151.29 339.42 752.79 1664.16 3655.86 8004.38
ahppi2 6.45 15.25 34.45 76.97 168.97 375.37 na*
gmp-gauss 4.53 11.80 30.99 68.75 175.02 425.77 na*
hfloatpi 5.90 17.92 43.61 95.70 212.61 458.78 1052.05 na*
piologie 6.57 16.35 39.99 91.80 212.94 492.66 1155.22 na*
SuperPi 15 36 83 186 375 866 1905 3867 8199 na*

A few quick notes about the above runs:

I have a nice graph of the growth of the various programs here.

Send comments or questions to zdjahromi@zgmail.com (remove the letter 'z' from the address before sending).

Pages last updated: July 17, 2005

valid xhtml