|UPDATE: Co-worker Bernardo Casano did a more detailed post on the Raspberry Pi 2, including overclocking details and even CPU temperature and energy usage. Check out his blog post here.|
You might recall that I’ve done some benchmarks for the 2nd generation Pi’s (the Model B’s) – using two different methods, here and here. Well, using the better C++ version, I saw results like this from that run:
Well, I finally got my Raspberry Pi 2 in the mail today, so I thought I would try that out. I did basically the same thing. I used the source code from here, to create a new “benchmark.cpp” file in my home directory:
$ pico ./benchmark.cpp
then, paste the contents of the .cpp file and save. Then, run the following:
$ g++ -fopenmp ./benchmark.cpp -o bench
$ export OMP_NUM_THREADS=4
Note that since the new Raspberry Pi 2 is a quad-core processor, I set the threads to 4. Sure enough, when it’s running, all of the CPU’s are pegged at 100% (this is using “htop”, run “sudo apt-get install htop” to install, then “htop” to run):
What were the results?
With the default settings on the Pi 2, this same operation ran in 7.9 minutes! More than 4x faster than the Pi Model B, and still significantly faster than the dual-core Banana Pi.