Raspberry Pi 5 CPU Performance

David Lee
4 min readNov 10, 2023

Raspberry Pi machines are incredibly fun to use. They’re cheap, capable, and it’s easy to find examples of how to use them to solve a wide variety of problems. When the Pi 5 was announced on September 28 I couldn’t wait to play with it.

The power-hungry Raspberry Pi 5 (photo by author).

I started by measuring CPU performance, since most of my projects are CPU-bound. Below I compare the Pi 5 with a variety of other machines including a recent Intel 13th gen, the SiPeed Lichee Pi 4A, the Microsoft/Qualcomm SQ3, the Apple M1, older Raspberry Pi models 4 and 3 B, and a ten-year-old Intel i7–4770K chip.

For the benchmarks, I used one app written, built, and run in a variety of environments. The app is simple — it proves that you can’t win at tic-tac-toe if the opponent is competent. It evaluates the 3 unique opening moves using the minimax algorithm with alpha/beta pruning. 6493 board states are examined. Variations include:

  • Native assembly versions for each target CPU. I’m sure the code could be further optimized, but I tried to take advantage of each CPU’s instruction set and registers. Variations include Arm32, Arm64, RISC-V 64, and AMD64.
  • Native assembly versions for the 6502, 8080, 8086, and RISC-V 64 CPUs run in various emulators: NTVAO (6502 + Apple 1), NTVCM (8080 + CP/M 2.2), NTVDM (8086 + DOS 3.3), RVOS (RISC-V 64 + Linux). All of the emulators are written in C++ and built using the target platform’s native compiler.
  • A C++ version of the algorithm. I used the platform’s default compilers — Microsoft for Windows, clang for MacOS, and Gnu for Linux distributions. Gnu and clang can target Windows and they generate much faster code (often >20%) than Microsoft’s compiler. But I went with what most folks are apt to use by default.
Runtimes for various benchmarks for each CPU.
Runtime details including the last column with the official Pi 5 adapter (5.1V 5A), which enables better multi-core performance than a generic 5V 3A adapter.

The Raspberry Pi 5 is significantly faster than prior versions of the Pi. This will enable many new Pi solutions; I can’t wait to see what comes of it.

A few notes on the benchmark results:

  • All times are in milliseconds for one iteration of proving you can’t win at tic-tac-toe.
  • I used a 5 volt 3 amp adapter for the Pi 5. It wants 5 volt 5 amps and displays a “low voltage” error in the notification area of the screen with my adapter. Official adapters are available from Pi 5 vendors, but they are scarce right now. And I couldn’t easily find generic adapters that deliver five amps. The dozen USB adapters in my house all deliver 1 to 3 amps at 5V. It’s possible the Pi 5 underclocks when it sees a lower-power adapter, so once I get the real adapter the benchmark times may improve. Update: The official Pi 5 adapter is 5.1V at 5A. Using this adapter, I no longer get the “low voltage” warning. Single-core performance is the same, but 3-core performance is over 11% better. I added a new column to the table above to reflect this.
  • The Pi 5 is a little more than twice as slow as the Apple M1. That’s actually really fast.
  • As mentioned above, the Microsoft C++ compiler for AMD64 is worse than the clang and Gnu compilers. But the performance gap for Arm64 is even wider. The Microsoft/Qualcomm SQ3 runs the same Arm64 assembler code at roughly the same speed as the M1 but C++ apps are dramatically slower. This makes the Pi 5 more competitive with Windows machines even though it has a less powerful CPU.
  • The Intel i7–4770K is ten years older than the Pi 5, yet even with Microsoft’s slower compiler it performs much better.
  • The table shows runtimes for the RVOS emulator running a nested version of the RVOS emulator. Here the Pi 5 greatly outperforms prior versions of the Pi mostly because emulating a 64 bit CPU on a 32 bit machine is expensive. I’m sure the Pi 4 with a 64 bit OS would perform better than with the 32 bit OS.

These benchmarks reflect performance for scenarios important to me, and it’s clear the Pi 5 is much faster than prior iterations. Now I’m off to try to find a better power source.

(Note: source code for the tic-tac-toe implementations is at https://github.com/davidly/ttt. Code for the emulators can be found at https://github.com/davidly/ntvao, https://github.com/davidly/ntvcm, https://github.com/davidly/ntvdm, and https://github.com/davidly/rvos.)

(Note 2: In the 1970’s I built 5V power supplies from parts purchased at Radio Shack to power projects I built with TTL chips. It seems I need to build my own 5V power supply all over again 50 years later.)

(Note 3: I purchased an Anker USB power supply that can deliver 5V at 4.5A. The Raspberry Pi 5 still shows the “Low Voltage Warning” notification and performance is no better.)

(Note 4: I ran the Arm32 version of the assembly app on the Raspberry Pi 5. Its times are .0919 and .0407 for 1 and 3 threads. That’s slower than the Arm64 version (Arm32 has fewer registers than Arm64), but still about 2x faster than the Raspberry Pi 4.)

--

--

David Lee

Seattle software engineer, adverb, seeker of musical transcendence. he/him/cis/white/straight/old/ugly/dull