- 3D Print a Base for Your RPi and Pi-Plate
- LAN/WiFi Speaker Switch
- Solar Powered Remote Environmental Data Logger
- Raspberry Pi HQ Camera Mount
- Using a THERMOplate to Measure Temperatures on the RPi4
- Making Sparks with Pi-Plates
- Dual Syringe Pump
- Cigarbox Pi
- Benchmarking the Pi 3
- Turn Your Raspberry Pi into a Network Monitoring Tool
- Using Pi-Plates with the Raspberry Pi 400
We picked up a Pi 3 at Microcenter today (limit 1 per customer) and decided to repeat the benchmark that we performed on the Pi 2. This benchmark is a simple number cruncher that calculates the first 50 Fibonacci values 1000 times and prints out the average time required to calculate those 50 values. It is strictly a CPU test. The code looks like:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
import time def fib(n): a,b = 1,1 for i in range(n-1): a,b = b,a+b return a while(1): N=1000 acc=0 start = time.time() for j in range(N): for i in range(50): fib(i) stop=time.time() acc=acc+(stop-start) start=stop print acc/N |
To run test, we opened four SSH sessions and ran the above code in each session. Just like the Pi 2, you can have up to four threads without a performance hit since there are 4 cores. Here's what the results looked like this time:
And here are the results from the Pi 2:
We can see from the above that it took the Pi 2 about 1.38 milliseconds to calculate the first 50 Fibonacci numbers. The Pi 3 on the other hand did it in roughly 1.08 milliseconds. That is a speed improvement of about 27.8%. Given that CPU clock has been raised from 900 to 1200 Mhz, these results appear to be pretty much on the mark. So once again, the engineers at RapberryPi.org have raised the bar. And while it's not the quantum leap that the RPi 2 was, a 27.8% boost in speed along with WiFi and Bluetooth at the same price point as its predecessor is still a great accomplishment.
A couple of final notes, we used the on-board WiFi to connect the Pi 3 and saw no issues with connectivity or thruput. In addition, there have been some reports of the CPU getting very hot during benchmark tests like this but since our was covered with a DAQCplate, we did not have an opportunity to verify this.