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 the 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.

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

The results are time intervals in seconds for the calculation of 100, 1000, 3000 digits. They also contain the upper limits 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 measures time; 2) it uses an OS function to print digits, it prints 4 digits a time synchronously with the calculation of them; 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.

CPU frequencies given are maximum available (known to me) for computers listed below. They are actual frequencies used during measurements.

FORMAT: Data for CPU and IO parts are calculated, so they are only some approximations. They are less accurate for display outputs because timings for the vertical scrolling are not taken into account. They have also some small deviations (about 5%) for tcp/ip connections because of not linear timing for the char output in this case.


*The automatic DRAM regeneration doesn't work at this clock (@1.78MHz) so it is possible that some hardware and software can't work with this speed. So, for normal system work, the maximum clock frequency is about 1.34 MHz, or 75% of that that used for the results given in the table.

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 (CPU time only without IO) of the calculation of 3000 digits by the CPU frequency. The ER values are gotten for pi-spigot which uses base 16-bit integer arithmetic. The best ER value for each CPU is taken.

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


The next table contains the sizes of the programs.
ProgramSize
pc386-5603
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 header
*** it is a size of the TAP-file
° it is a size of the assembler + C code without a loader and C-libraries

Thanks a lot for people who helped: bqt, ivagor, perestoronin, BigEd, tricky, MMS, Thorham, meynaf, ...


Download the latest sources and executables (v36 [161 KB]) pack.

Sources Archive