By Jim Connors on Feb 17, 2015
Having surpassed 4 million units shipped and clearly establishing itself as a de facto reference platform, the folks at the Raspberry Pi Foundation are not resting on their laurels. Earlier this month (February 2015), they introduced the Raspberry Pi 2 Model B:
Compared to its predecessor, the Raspberry Pi B+, this newer model is packaged with a Broadcom BCM2836 SoC at 900MHz. It is not only superior in performance to the original single core BCM2835 processor on core-by-core basis, it now brings the added benefit of including 4 cores. Add to that a doubling of RAM from 512MB to 1GB and it should be no mystery that this new platform can handle more serious workloads. Later on down, a chart compares the SPECjvm2008 benchmark performance of the original Raspberry Pi Model B with the new Raspberry Pi 2 Model B.
In addition to the substantial performance bump, major kudos are to be given to the Raspberry Pi Foundation engineers for their focus on hardware and software compatibility:
- The Pi2 maintains the same physical form factor as the Raspberry Pi B+, meaning that all of the previous accessories (USB power cable, serial console cable, microSD card ...) all work perfectly well with the new version. That also includes any Raspberry Pi B+ enclosures you may have too.
- The ARMv7-based BCM2836 processor is backwards-compatible with the original ARMv6 version. In order to maintain binary compatibility, the latest version of the Raspbian distribution will boot either the new or old versions of the Raspberry Pi. Note that in this mode, applications will not be able to take full advantage of the ARMv7 enhancements. Alternate OS distributions may provide the extra performance boost at the expense of breaking backwards compatibility.
- Perhaps best of all, the Raspberry Pi maintains its appeal to the masses. At approximately £23/$35, no price increase comes along with this upgrade.
The chart that follows examines Raspberry Pi Java performance via the SPECjvm2008 benchmark. Both original and Raspberry Pi 2 systems ran the latest available Raspbian Image (2015-02-02) and the latest available Java 7 JDK (Java 7 update 72)1. The four vertical bars (blue, red, green, purple) represent four separate runs of the benchmark:
- Blue: Raspberry Pi Model B. Invoked with JVM argument -Xmx400m specifying a maximum heap of 400MB.
- Red: Raspberry Pi 2, single threaded. Invoked with JVM argument -Xmx400m specifying a maximum heap of 400MB, and application argument -bt 1 instructing the SPECjvm2008 test harness to run the benchmark tests with a single thread. This is meant to approximate an apples-to-apples comparison of single core performance between the two Raspberry Pi systems.
- Green: Raspberry Pi 2, multithreaded (default). Invoked with JVM argument -Xmx600m specifying a maximum heap of 600MB2.
- Purple: Raspberry Pi 2, multithreaded (default), larger heap. Invoked with JVM argument -Xmx900m specifying a maximum heap of 900MB3.
The larger the measurement (ops/min), the faster the result, the single core performance of the Raspberry Pi 2 is a big improvement over its predecessor. As the SPECjvm2008 suite does include a healthy dose of mutithreaded code, enabling the test harness to take advantage of the 4 hardware threads available to the Pi 2 added another huge jump in performance. And finally utilizing the extra RAM (in the form of a larger heap) provided for by the Raspberry Pi 2 yields only a very modest gain in throughput. In particular, 2 of the 11 component tests (compress, xml) show an improvement with the extra heap. For more detailed results, you can view this spreadsheet.
The added horsepower that the Raspberry Pi 2 brings solidifies the Raspberry Pi family as an important reference platform in the present as well as the future for companies like Oracle. As the Internet of Things phenomena plays out and more processing is brought to the edge, the new Raspberry Pi is better suited to handle the increased workload that applications like Oracle Event Processing for Oracle Java Embedded and others require.
1 The latest Raspbian distro includes a recent version of Oracle's Java 8 JDK. Unfortunately
the somewhat dated SPECjvm2008 benchmark has a dependency that requires
Java 1.7 or earlier, so for these benchmarks, we needed to use a Java 7
JDK. The latest available, 7u72, was used for these tests.
2 With 4 cores, the SPECjvm2008 test suite would produce an OutOfMemoryError when run with the initial max heap size argument of -Xmx400m. Increasing the max heap size to 600MB (-Xmx600m) enabled the tests to complete. Evidently SPECjvm2008 requires more heap space as more hardware threads are configured in.
3 In order to utilize the full amount of RAM (1GB) available with the Raspberry Pi 2, a firmware upgrade may be required. If necessary, you can invoke 'sudo rpi-update' from a linux shell on the Raspberry Pi 2 to accomplish this task.