Raspberry Pi vs. Beaglebone Black: Performance

on January 27 | by

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 Responses

  1. Gonewest says:

    One key metric to capture is how quickly that script’s iterations of the loop are performed in each case. I would be perfectly fine with using more cpu if I’m getting more work done.

    • Rachel Gibbs says:

      It was very interesting to watch the difference in output speed as I was watching the scripts run. The BBB would stop for a split second after each loop, but the Pi chugged along with no pauses.

  2. Brandon says:

    Can you do it again with a PI2 plz?

  3. jerry isdale says:

    What tasks are running in the “Basic CPU Usage” case? There may be more daemons spawned in BBB than Pi, which would account for the basic difference. The core processors are both ARM but of fairly different classes.
    The BBB’s AM3358 is a Cortex-A8 class, with floating point, onchip graphics, etc. http://www.ti.com/product/am3358
    The Pi’s AM1176 is an older core without onboard graphics. http://www.arm.com/products/processors/classic/arm11/arm1176.php
    The Pi has that nice broadcom chip to do fast HD video that in some cases more than makes up for difference https://www.broadcom.com/products/BCM2835

    • Rachel Gibbs says:

      Yes, that’s a good point and something I considered. I decided to just do an out-of-the-box test with comparable operating systems for a more “practical” comparison, but it wouldn’t surprise me at all if the BBB ran more background tasks too.
      The “Basic CPU Usage” was simple standing usage with the performance script running (which can sometimes use quite a bit of resources itself). It was taken as soon as the device was booted up with only the performance script running.

  4. […] took a while to get my hands on one, but once I did I wanted to run the same performance test that I did on the B+ and Beaglebone Black. This basic comparison looks at CPU performance while running a simple […]

Leave a Reply

Your email address will not be published. Required fields are marked *

« »

Initial State Technologies, Inc.
Scroll to top
Initial State