Raspberry Pi3 vs. DragonBoard: Python Application Development
Author: Nikolai Khabarov, Embedded Expert DataArt, Evangelist for Smart Home Technologies.
Python is ideal for creating simple PoC projects. We will not enumerate all the advantages of this language; let us pay attention to a feature that seems to us to be one of the most interesting - cross-platform. Thanks to her, Python is very convenient for creating embedded systems. No need to compile binaries, no need to deploy applications. The same code works on both PCs and Linux-based single-board solutions (for example, Raspberry Pi).
However, this approach has its limitations. It cannot be used for some projects that require certain hardware (for example, desktop PCs may not have and most likely will not have SPI, I2C, etc.). And, of course, boards based on the ARM architecture are slower than a personal computer. Therefore, in some cases, an algorithm that works fine on a PC will not be productive enough on the embedded system. ')
High performance was important for one of our recent projects .
We used the Dragonboard 410c as one of the target platforms and were pleasantly surprised by the performance of the board. Even without an instrumental benchmarking, we noticed a significantly higher speed when installing OS packages, running applications, and overall performance compared to Raspberry Pi 3. Let's look at the specifications of the boards:
Pay
Raspberry pi 3
DragonBoard 410c
CPU
BCM2837, Quad-core ARMA53 (v8) 1.2GHz
Snapdragon 410E, Quad-core ARMA53 (v8) 1.2GHz
Memory
1GB
1GB
The characteristics are about the same - they do not explain the best performance of DragonBoard, which we saw with our own eyes. Therefore, we conducted a performance test to make sure that this board is really faster.
We decided to measure on these boards the performance of Python 3 - the most interesting for us version of this programming language. We used the Python Performance Benchmark Suite , which is mainly based on real-world performance tests, rather than synthetic benchmarks, and uses existing applications wherever possible.
We used our favorite OS for embedded platforms - Ubuntu Core 16 . This is a consistent operating system with transactional updates, which (most importantly) supports both boards participating in our testing. We installed Ubuntu Core on the SD card and used the snap “classic” to create the traditional ubuntu environment for the test.
The test lasts long enough, so we used this complex command to test in the background without an active ssh connection. It also avoided the problems caused by breaking the same ssh connection, which would have stopped the test.
Here is what we got in the end:
The results surprised us greatly. DragonBoard performance is almost twice as high as that of the Raspberry Pi 3! Of course, do not forget that the official Linux kernel for Raspberry Pi 3 has a 32-bit armhf (v7) architecture, and the DragonBoard 410c core has a 64-bit amr64 (v8) architecture. Probably, the performance difference is caused by the fact that Python uses 64-bit calculations.
Let's also run a sysbench test using native code. Sysbench includes several tests that we would like to run: cpu, memory, threads, mutex. These tests are more "synthetic", but in any case, let's compare the net computing power of the boards. Results below:
Test
Raspberry pi3
DragonBoard 410c
cpu sysbench –test = cpu run
318.1229s
12.6500s
memory sysbench –test = memory –memory-total-size = 2G run
7.5322s
3.0507s
threads sysbench –test = threads run
23.1469s
9.1600s
mutex sysbench –test = mutex run
0.0283s
0.0141s
According to the cpu test results, the DragonBoard 410c processor was 25 times faster than the Raspberry Pi. This is due to the fact that in the cpu test, calculations with 64-bit numbers are used, in which case the 64-bit operating system really has a big advantage. Other tests showed that DragonBoard's performance is about twice as high, which is generally in line with pybenchmark. It should be noted that the 64-bit kernel should not affect the testing of the threads test.
Of course, there is always the opportunity to develop your project using C or even just one assembler and get the best performance. But usually the development time is more expensive than the cost of payment. Using tools like Python is cheaper, more efficient and more productive. With their help, you can create a better product and bring it to market faster. The performance degradation caused by Python can easily be overcome with a more powerful board. We really hope that the official maintainers will release the 64-bit version of the Raspberry Pi core, but today the ideal choice for developing embedded Python applications remains the DragonBoard 410c.