Raspberry Pi vs. Beaglebone Black: Performance

Quite a few Single Board Computers have made it to market and are gaining popularity with makers everywhere.  Two of the biggest players in this space are the Raspberry Pi and the Beaglebone Black.  Both advertise their various advantages, with the Raspberry Pi focusing on ease and educational use and the Beaglebone offering more centralized flexibility at the price of a higher learning curve.  That being said, both SBCs are amazing pieces of hardware!

I thought that it might be a neat experiment to do a basic comparison of the Raspberry Pi versus the Beaglebone Black by looking at CPU performance while running a simple script.  You may have seen my previous post on monitoring the computer performance – I simply ran this script for a little bit before starting my “stress test” script so that I could see average CPU usage before, during, and after the stress test.

If you’d like to replicate my test, you’ll need to install psutil with 

sudo pip install python-psutil

along with the Initial State streamer.

data streaming icon
software icon, code icon

I ran this experiment on a Rasberry Pi B+ running Rasbian and an element14 Beaglebone Black running Debian.  I tried to use various resources by having my test script ping Google, perform addition, stream to Initial State and append to an array in a tight loop.  To make things even more interesting, I also ran a trial with floating point division added in.

## Import subprocess to make calls like in the terminal
import subprocess
## Import the ISStreamer module
from ISStreamer.Streamer import Streamer

## Streamer constructor, this will create a bucket called Computer Performance
## you'll be able to see this name in your list of logs on initialstate.com
## your access_key is a secret and is specific to you, don't share it!
streamer = Streamer(bucket_name="Performance Test",access_key="[Your Access Key Here]",buffer_size=20)

## Initialize a number
numforstr = 12345

## Create an array
array = [str(numforstr)];

## Tight while loop b/c no sleep
while True:

	## Ping Google
	res = subprocess.call(["ping","-c","1","www.google.com"])
	## Add to our number
	numforstr = numforstr + 12345
	## Stream the current number
	streamer.log("Number",numforstr)
	## Add to our array
	array.append(str(numforstr))
	## Stream the last object in the array
	streamer.log("Last Array Index",array[len(array)-1])
	## Uncomment to perform division
#	div = numforstr/12344

To analyze my data, I used Initial State’s signal statistics.  These first two screenshots show the Pi and BBB’s CPU usage while no script is running.

raspberry pi performance, raspberry pi cpu statistics
Raspberry Pi average CPU usage running boot environment
beaglebone black performance, beaglebone black cpu statistics
Beaglebone Black average CPU usage running boot environment

You can see the Raspberry Pi was using 19% while the Beaglebone Black was using 25% of its CPU power.

Next I looked at running the test script without the division.

raspberry pi performance, raspberry pi cpu statistics
Raspberry Pi average CPU usage while running script without division
beaglebone black performance, beaglebone black cpu statistics
Beaglebone Black average CPU usage while running script without division

So the Pi’s CPU percent went from 19% to 64%.  The Beaglebone Black jumped from 25% to 35%.  It’s also interesting to note the raggedness of the Beaglebone’s usage versus the smoothness of the Pi’s.  Not sure if this has something to do with psutil, but I feel like further investigation might provide an interesting reason for the difference.

Then I added division.

raspberry pi performance, raspberry pi cpu statistics
Raspberry Pi average CPU usage while running script with division
beaglebone black performance, beaglebone black cpu statistics
Beaglebone Black average CPU usage while running script with division

Here the Pi’s average percentage barely budged – only changing by 0.13%.  The Beaglebone Black, however, made a 7% leap from 35% to 42%.  This higher percentage is still lower than the Pi’s though.

So for a brief recap in case you didn’t want to read all of that:

Raspberry Pi B+ Beaglebone Black

Basic CPU Usage (Avg %)
19.07 25.25
CPU Usage During Script Run (Avg %)
64.38 34.83
CPU Usage During Script Run w/Division (Avg %)
64.51 41.67

I thought it was pretty interesting that the Pi used a smaller percentage initially but took a lot more CPU % to run the script. The difference between dividing and not was also surprising since it seemed to barely effect the Pi compared to the BBB.

This little test barely scratched the surface of what you can discover on the Pi and BBB by running different types of scripts and paying attention to different parameters that psutil returns. Initial State also makes it really easy to see what happened and get quick analysis on your results. So go experiment some more and let me know what you find!

8 comments On Raspberry Pi vs. Beaglebone Black: Performance

Leave a reply:

Your email address will not be published.

Site Footer