Just another WordPress site

Main menu

Post navigation

Some Raspberry Pi 2 Benchmarks

This article presents a few informal benchmarks comparing the Raspberry Pi to the Raspberry Pi 2. The original Pi has a single core ARM v6 processor. The Pi 2 is quad core, ARM v7, and clocked faster than the Pi 1. But is it really six times as fast, as the makers claim ? Short answer: yes it is. And then some.

Single Core Test

Gzipping a file is a CPU intensive task. Let’s see how both Pis perform when asked to gzip a large file of 237 MB. The Pi1 will go first:

Multi Core Test

Hang on though, doesn’t the Pi Foundation claim a performance improvement of “at least 6x” for the new Pi2, as mentioned in the same Register article ? Ah, well, the Pi2 has four CPU cores, and only one of them was used in the test above. Fine, lets get all four cores running, and see what happens.

By using four cores in parallel, the Pi2 has zipped all the data in 32 seconds, improving on the Pi1’s performance by a factor of 8.3. That, as they say, is a spicy meat ball. And it certainly backs up claims of an “at least 6x” performance improvement.

Note. Here is an example of a top command run during the gzip test. Each of the Pi2’s four CPUs are running at nearly 100%.

More CPU Intensive

Pi2 is outperforming Pi1 by a factor of 8.3. But can it do more ? In order to flex those Pi2 muscles properly, let’s take an even more CPU bound task. Calculating a checksum on that big file will get those CPU cores really humming. Check out the Pi1:

The Pi2 outperformed the Pi1 by a factor of 15.6 (366/23.4). The Pi2 has also exceeded its own single-core performance by a factor of 88.6/23.4 = 3.49, close to a factor of 4x which the number of cores would naturally suggest.

Note The “time” command records 1 minute and 29 seconds of “user” time elapsing, even though only 23.397 seconds passed in real time. This is a quirk of the time command – adding up “user” time for each core.

Conclusion

For single threaded, CPU intensive processes, the Pi2 is typically 3 times faster than the Pi1, rising to 3.8 or so for very CPU bound processes. For multi-threaded applications, the improvement is 6x or more. For example it is up to 8.3 when compressing a file, and up to 15x for pure CPU bound activities such as checksumming data. This is easily demonstrated on the command line and confirms the Pi Foundation’s claims.

The performance jump offered by the Pi2 will also be obvious to anyone using the LXDE GUI, the Epiphany web browser or any other large, multi-threaded application. To check if an app is multi-threaded, use ps -eLfP. For example, Epiphany is now running on my Pi2 with 11 threads, scattered like snow across the 4 processors. The PSR column identifies the core:

The same command (without the grep) will show many LXDE background processes and threads running across all four cores.

Backround Information

Question: In the test on the Pi2 above, how do we know that there is a gzip process running on each CPU core ? Might they not all be running on one core ?

Answer: Take a look at the first top output above. Four gzip processes each taking over 90% CPU time. A total of 490%. That is only possible if each gzip is running on a separate CPU core. Also, note the “R” in the Status (“S”) column. R means running, indicating that all 4 processes are on the CPU (in a core) at the same time.

The PSR column shows the ID of the CPU running each process. It can be seen that each gzip command is indeed in a different CPU (ie. core). And again, the S (“Status”) column shows every gzip is running.

Technical Information

All tests were performed using the same external USB2 disk.

The timings shown in the article are averaged, calculated from 3 or 4 runs of each test.