# 32- or 64-bit: Speed

Below are the execution times (or speeds) of various benchmark code from this site run on Raspbian (32 bit), and Ubuntu 20.04LTS (both 32 and 64 bit).

Benchmark | Raspbian | U20.04 | U20.04 32bit |
---|---|---|---|

linpack.py | 3790MFLOPS | 4490MFLOPS | 3000MFLOPS |

linpack.py 5000 | 6550MFLOPS | 8500MFLOPS | 6050MFLOPS |

ditto, single core | 2440MFLOPS | 4200MFLOPS | 2400MFLOPS |

stream | 5560MB/s | 5200MB/s | 5200MB/s |

stream_mp | 3770MB/s | 3500MB/s | 3550MB/s |

mersenne_fast.py | 19.0s | 7.4s | 20.4s |

logistic_v2.py | 22.1s | 26.0s | 22.1s |

mandel_v2.py | 37.4s | 34.5s | 40.5s |

primes_v4.py | 20.2s | 13.5s | 17.0s |

primes.c | 1.4s | 1.0s | 1.8s |

seriesA_hp.py | 37.3s | 3.2s | 37.2s |

sums.c | 2.2s | 2.2s | 2.2s |

gas.py | 60.5s | 65.0s | 62.5s |

### Notes

The Linpack results use the version of OpenBLAS supplied by the OS.

gas.py uses the three-atom simulation (change `if (False):`

to
`if (True):`

, circa line 170).

### Commentary

The python benchmarks which use very long integers (mersenne_fast and seriesA_hp) run significantly faster on the 64 bit OS than on the 32 bit ones. This is expected, as python breaks the very long integers down into half as many "digits" on the 64 bit machines, making additions about twice as fast, and multiplications about three to four times as fast. For mersenne_fast the speed-up is within the expected range. For seriesA_hp it is not, which means there must be some other effect.

Most of the benchmarks which do not use integers longer than 32 bits do not show very much speed difference between the 32 and 64 bit OSes. In several cases the random fluctuations in timings may be more significant. The exception is the Linpack benchmark.

My conclusion, therefore, is that should Raspbian move to being 64-bit, most applications will see a minor speed change, no more than one normally expected between different revisions and different revisions of compiler. But a few will see significant improvements.

(In January 2022 a non-beta 64-bit version of Raspberry Pi OS appeared. It was based on Debian 11, rather than the Debian 10 of the previous 32-bit version. Compiler and library improvements will have helped performance too.)