The number π calculation by spigot algorithm benchmark

The table below consists of the best results for the listed computers. It is open for the further expansion. So if anybody has faster implementation of spigot algorithm for one of systems listed below then please inform author of this page (to vol.litwr at gmail dot com) and it should be updated. The same is true for the results of other systems missed in the table.

The results are time in seconds for the calculation of 100, 1000, 3000 digits. They also contain the upper limit to the number of digits for the programs used. The data are sorted by time for 3000 digits.

Every program is satisfying four restrictions: 1) it calculates time; 2) it uses an OS function to print digits; 3) it uses less than 64 KB RAM for the code and data; 4) it utilizes all available RAM below 64 KB limit to get the maximum number of calculated digits, so it is forbidden to restrict artificially the maximum number of digits.

ComputerOSProgram
version
DigitsMax
digits
Emulator used and its quality
10010003000
Acorn A3020RiscOSarm2-10.043.5319144real iron (thanks to danielj)
Amiga 1200/PAL with fast RAMWBamiga1200-40.094349256corrected FS-UAE 2.6.2 (almost high)
IBM PC Clone 386DX @12.5MHzDOSpc386-40.054359268real iron
IBM PC Clone 386DX @12.5MHzDOSibmpc-50.054.2369264real iron
Amiga 1200/PALWBamiga1200-40.124.8379256real iron (thanks to cyberfred91 & Thelemorf)
Amiga 1200/PALWBamiga-40.145.4439252real iron (thanks to cyberfred91 & Thelemorf)
BBC A305RiscOSarm2-10.065.1459144real iron (thanks to sirbod)
Acorn Archimedes 440/1RiscOSarm2-10.065.1459144real iron (thanks to steve3000)
ARM Evaluation system @6.67MhzROM OSarm1-40.075.8529148real iron (thanks to BigEd) & estimation
IBM PC 5170 AT 8MHz VGADOSibmpc-50.117.1609264real iron (thanks to modem7) & estimation
VAX 11/785OpenVMS 7.3vax-vms-20.117619228real iron (thanks to LCM+L)
IBM PC Clone 386DX @6.25MHzDOSibmpc-50.118699264real iron
IBM PC 5162 XT/286 VGADOSibmpc-50.118.2719264real iron (thanks to per) & estimation
Acorn Master 512 (TUBE 80186 @10MHz)DOSmsdos-5-master5120.148.7759264real iron (thanks to george.h) & estimation
IBM PC 5170 AT 6MHz CGADOSibmpc-50.2110.2839264real iron (thanks to modem7) & estimation
Commodore SuperCPU-64/PALROM Basicscpu64-50.19.7877024VICE Version 2.4.22 (high)
Commodore SuperCPU-64/NTSCROM Basicscpu64-50.110907024VICE Version 2.4.22 (high)
microPDP-11/83RT11SBrt11-eis-50.1411.4102up to 6580real iron (thanks to form) & estimation
microPDP-11/70Unix v7pdp11-unix7-eis-10.1711.9104up to 7312real iron (thanks to LCM+L)
Commodore SuperCPU-64/PALROM Basicc64-90.1514.91336360VICE Version 2.4.22 (high)
Commodore SuperCPU-64/NTSCROM Basicc64-90.1515.21366360VICE Version 2.4.22 (high)
Amiga 500/PAL + fast RAMWBamiga-40.4219.71649252FS-UAE 2.6.2 (high)
Amiga 500/PALWBamiga-40.44201679252FS-UAE 2.6.2 (high)
BBC Micro (TUBE Acorn 32016 @6MHz)Pandorabbc-pandora-20.2421.31909188real iron (thanks to Chris) & estimation
BBC Micro (TUBE Acorn 32016 @6MHz)PanOSbbc-panos-20.2821.61919264real iron (thanks to Chris) & estimation
MSX turbo RROM Basicmsx-30.2522.11983264openmsx 0.10.1 (high)
microPDP-11/83RT11SBrt11-noeis-50.2622.5202up to 6500real iron (thanks to form) & estimation
microPDP-11/70Unix v7pdp11-unix7-noeis-10.3224.8219up to 7164real iron (thanks to LCM+L)
Dragon 32 (6309 CPU)ROM Basicdragon-6309-30.4541.73743176XRoar 0.34.1 (medium)
IBM PC 5150 MDADOSibmpc-50.6547.64079264real iron (thanks to modem7) & estimation
Tiki-100 (8088 board)DOSmsdos-5-tiki1000.8454.44719260real iron (thanks to per) & estimation
BBC Micro (TUBE 6502 @4MHz)ROM Basicbbc-50.7877.2691up to 3216real iron (thanks to BigEd and Kieran) & estimation
VAX 11/730BSD 4.3vax-bsd-11.587.27379244real iron (thanks to LCM+L)
BBC Micro (TUBE Acorn z80 @6MHz)ROM Z80 Basicbbc-z80-31.0596.78666252real iron (thanks to BigEd)
BBC Micro (TUBE Acorn z80 @6MHz)CP/Mcpm22bios-7-acorn1.0696.78678220real iron (thanks to BigEd) & estimation
BBC Micro (TUBE 6502 @3MHz)ROM Basicbbc-51.07106.4952up to 3216real iron (thanks to BigEd and hoglet) & estimation
Commodore +4/PALROM Basicplus4-101.48143.512837716real iron
BBC Micro (TUBE Torch z80 @4MHz)CPNcpm22bdos-7-torch1.62145.31300up to 8740real iron (thanks to danielj)
BBC MicroROM Basicbbc-51.61157.81411up to 3216real iron (thanks to BigEd and hoglet) & estimation
Dragon 32ROM Basicdragon-41.7157.614143100XRoar 0.34.1 (high)
Commodore 128/NTSCROM Basicc128-91.65159.414255044VICE Version 2.4.22 (high)
Commodore 128/PALROM Basicc128-91.7216614845044VICE Version 2.4.22 (high)
ZX Spectrum 48kROM Basiczx-11.9171.11529up to 4400fuse version 1.1.1 (high)
Amstrad CPC6128ROM Basiccpc-52.04174.51556up to 5536ep128emu version 2.0.9.1 (very high)
Tiki-100KP/Mcpm22bios-7-tiki1002.04175.715677636real iron (thanks to per) & estimation
Commodore +4/NTSCROM Basicplus4-101.83177.415867716plus4emu version 1.2.9.2 (very high)
Amstrad CPC6128CP/M 2.2cpm22bios-7-cpc61282.16183.116315988ep128emu version 2.0.9.1 (very high)
Amstrad CPC6128CP/M 3cpc-cpm3-62.36191.51697up to 8660ep128emu version 2.0.9.1 (very high)
Amstrad PCW8256CP/M 3cpm22bdos-7-pcw82562.09191.11712up to 8624real iron (thanks to habi) & estimation
MSX 1, 2, 2+ROM Basicmsx-32.27205.61841≈3000openmsx 0.10.1 (very high)
MSX 1, 2, 2+MSX DOScpm22bdos-7-msx2.42101876up to 7488openmsx 0.10.1 (very high)
БK0011 (PDP-11 architecture)БK0010 OSbk11-42.68242.121884412BK2010 (Java) 0.5-release (medium) & estimation
БK0010 (PDP-11 architecture)ROM Monitorbk10-53.13273.324463824BK2010 (Java) 0.5-release (high)
БK0011 (PDP-11 architecture)RT11SJrt11-noeis-53.34288.82606up to 5452BK2010 (Java) 0.5-release (medium) & estimation
Commodore 64/NTSCROM Basicc64-93.05301.626996360VICE Version 2.4.22 (high)
Commodore 64/PALROM Basicc64-93.17313.228026360VICE Version 2.4.22 (high)
Commodore 128/NTSC z80CP/M 3cpm22bdos-7-c1284.2358.53194up to 8184VICE Version 2.4.22 (high)
Commodore 128/PAL z80CP/M 3cpm22bdos-7-c1284.3372.13316up to 8184VICE Version 2.4.22 (high)

This algorithm speed depends very much on the speed of integer division. So systems with hardware division have a big advantage.

The results above allow to calculate CPU efficiency for 1 Mhz. The next table contains approximate values of efficiency reciprocals (ER). These values are calculated by multiplication of the time of the calculation of 3000 digits by the CPU frequency. ER values are gotten for pi-spigot which uses base 16-bit integer arithmetics. The best ER value for each CPU is taken.
RankCPUER
1ARM1350
2ARM2360
3ARM250370*
480286430
580386440
6VAX-11/780460
768020480
86309670
980186750
10320161140
11680001160
12R8001420
13KB11C1730
14658161740
15J111840
1680881940
1768092520
18VAX-11/7302730
1965022760
20Z805200
21K1801BM17340**

* ARM250 shows a bit slower performance than ARM1 because it has more delays with RAM at A3020
** the tested systems use a very slow RAM interface, with the pefect one the speed will be 4700

The next table contains the details about the tested systems in the chronological order.

SystemYearCPU
DEC PDP-11/701975KB-11C 16.7 MHz
IBM PC 515019818088 4.77 MHz
BBC Micro19816502 2 MHz
ZX Spectrum 48k1982z80 3.5 MHz
Dragon-3219826809 ≈0.89–1.78 MHz
VAX-11/7301982VAX-11/730 3.7 MHz
Z80 Torch 2nd processor1982z80 4 MHz
Commodore 6419826502 ≈1 MHz
MSX1983Z80 3.58 MHz
Commodore +419846502 ≈0.9-2.2 MHz
VAX-11/7851984VAX-11/780 7.52 MHz
6502 Acorn 2nd processor19846502 3 MHz
Z80 Acorn 2nd processor1984z80 6 MHz
IBM PC 5170198480286 6 MHz
Tiki-1001984z80 4 MHz, optional 8088 4 MHz
Commodore 12819856502 ≈2 MHz, z80 ≈2 MHz
32016 Acorn 2nd processor198532016 6 MHz
Amstrad CPC61281985z80 4 MHz
Amstrad PCW82561985z80 4 MHz
Amiga 1000198568000 7.1 MHz
БK00101985K1801BM1 3 MHz
Acorn 2nd processor for BBC Micro19866502 4 MHz
ARM Evaluation system1986ARM1 6.67 MHz
Acorn BBC Master 512198680186 10 MHz, 6502 2 MHz
IBM PC 5170198680286 8 MHz
IBM PC 5162 XT/286198680286 6 MHz (0WS RAM)
BBC Archimedes 3051987ARM2 8 MHz
microPDP-11/831988J11 18 MHz
Acorn Archimedes 440/11989ARM2 8 MHz
БK00111989K1801BM1 4 MHz
MSX turbo R1990R800 7.16 MHz
IBM PC Clone 0WS RAM1991AMD 80386DX 6.25/12.5/25 MHz
Amiga 1200199268020 14.2 MHz
Acorn A30201992ARM250 12 MHz
Commodore SuperCPU-64199665816 20 MHz

The next table contains the sizes of the programs.
ProgramSize
pc386-4629
msdos-5635–640
pdp11-unix7-eis-1636°
ibmpc-5660
dragon-6309-3281+496=777*
vax-bsd-1816°
amiga1200-4868
rt11-eis-3894**
amiga-4904
vax-vms-2915**
bbc-pandora-2992
bbc-panos-21044
pdp11-unix7-noeis-11258°
dragon-4812+489=1301*
bk11-41448
bk10-51448
rt11-noeis-51490**
arm2-11504
arm1-41680
scpu64-51994
bbc-z80-31792+292=2084*
msx-31799+460=2265*
cpm22bios-72270–2283
cpc-cpm3-62288
cpc-51804+579=2383*
cpm22bdos-72266–2548
zx-14666***
bbc-56052+395=6447*
plus4-106531
c64-96597
c128-96597
* it is a sum of Asssember + Basic code sizes.
** it is a size of the pure code without a loader
*** it is a size of the TAP-file
° it is a size of the assembler + C code without a loader and C-libraries


Download the latest sources and executables (v27 [154 KB]) pack.

Archive