ARM平台常用性能测试方法
测试磁盘读写速度:
通过安装hdparm,可以测试EMMC的读写速度:
dolphin@localhost:~$ sudo apt-get install hdparm
dolphin@localhost:/dev$ sudo hdparm -Tt /dev/mmcblk1
/dev/mmcblk1:
Timing cached reads: 1202 MB in 2.00 seconds = 601.20 MB/sec
Timing buffered disk reads: 340 MB in 3.01 seconds = 113.01 MB/sec
dolphin@localhost:~/data$ dd count=50 bs=1M if=/dev/zero of=~/data/test.img
50+0 records in
50+0 records out
52428800 bytes (52 MB, 50 MiB) copied, 0.620573 s, 84.5 MB/s
测试CPU性能
sysbench是一款开源的多线程性能测试工具,可以执行CPU/内存/线程/IO/数据库等方面的性能测试。可以通过apt install sysbench来安装。
CPU 测试时,会计算素数(对这个数字除以 2 到这个数字平方根之间的所有数字来验证素数)直到某个指定值所需要的时间。
sysbench --num-threads=4 --test=cpu --cpu-max-prime=20000 run
可以看到RK3399在该测试下的结果是9.9957s:
Threads started!
CPU speed:
events per second: 1927.70
General statistics:
total time: 10.0027s
total number of events: 19301
Latency (ms):
min: 1.42
avg: 2.07
max: 22.63
95th percentile: 3.62
sum: 39982.94
Threads fairness:
events (avg/stddev): 4825.2500/2066.85
execution time (avg/stddev): 9.9957/0.00
另一个性能测试跑分软件是nbench,可以对单个核进行内存、整型运算和浮点运算性能测试,具体包括以下10个测试项,可以通过wiki参考链接进一步了解。
- Numeric sort - Sorts an array of long integers.
- String sort - Sorts an array of strings of arbitrary length.
- Bitfield - Executes a variety of bit manipulation functions.
- Emulated floating-point - A small software floating-point package.
- Fourier coefficients - A numerical analysis routine for calculating series approximations of waveforms.
- Assignment algorithm - A well-known task allocation algorithm.
- Huffman compression - A well-known text and graphics compression algorithm.
- IDEA encryption - A relatively new block cipher algorithm.
- Neural Net - A small but functional back-propagation network simulator.
- LU Decomposition - A robust algorithm for solving linear equations.
获取源代码,并编译运行。
wget http://www.math.utah.edu/~mayer/linux/nbench-byte-2.2.3.tar.gz
tar -xvzf nbench-byte-2.2.3.tar.gz
cd nbench-byte-2.2.3
make
./nbench
可以看到6核的RK3399在nbench中跑分整数和浮点数分数79.409与44.893
pi@NanoPi-NEO4:~/nbench-byte-2.2.3$ ./nbench
BYTEmark* Native Mode Benchmark ver. 2 (10/95)
Index-split by Andrew D. Balsa (11/97)
Linux/Unix* port by Uwe F. Mayer (12/96,11/97)
TEST : Iterations/sec. : Old Index : New Index
: : Pentium 90* : AMD K6/233*
--------------------:------------------:-------------:------------
NUMERIC SORT : 1242.3 : 31.86 : 10.46
STRING SORT : 389.92 : 174.23 : 26.97
BITFIELD : 2.2521e+08 : 38.63 : 8.07
FP EMULATION : 369.93 : 177.51 : 40.96
FOURIER : 23017 : 26.18 : 14.70
ASSIGNMENT : 21.776 : 82.86 : 21.49
IDEA : 6673.9 : 102.07 : 30.31
HUFFMAN : 2230.3 : 61.85 : 19.75
NEURAL NET : 39.53 : 63.50 : 26.71
LU DECOMPOSITION : 1050.7 : 54.43 : 39.31
==========================ORIGINAL BYTEMARK RESULTS==========================
INTEGER INDEX : 79.409
FLOATING-POINT INDEX: 44.893
Baseline (MSDOS*) : Pentium* 90, 256 KB L2-cache, Watcom* compiler 10.0
==============================LINUX DATA BELOW===============================
CPU : 6 CPU
L2 Cache :
OS : Linux 4.4.143
C compiler : gcc version 7.3.0 (Ubuntu/Linaro 7.3.0-27ubuntu1~18.04)
libc : static
MEMORY INDEX : 16.723
INTEGER INDEX : 22.505
FLOATING-POINT INDEX: 24.899
Baseline (LINUX) : AMD K6/233*, 512 KB L2-cache, gcc 2.7.2.3, libc-5.4.38
* Trademarks are property of their respective holder.
以下是S5P6818上使用32bit 系统的表现:
pi@NanoPi-Fire3:~/work/nbench-byte-2.2.3$ ./nbench
BYTEmark* Native Mode Benchmark ver. 2 (10/95)
Index-split by Andrew D. Balsa (11/97)
Linux/Unix* port by Uwe F. Mayer (12/96,11/97)
TEST : Iterations/sec. : Old Index : New Index
: : Pentium 90* : AMD K6/233*
--------------------:------------------:-------------:------------
NUMERIC SORT : 660.92 : 16.95 : 5.57
STRING SORT : 88.288 : 39.45 : 6.11
BITFIELD : 1.9179e+08 : 32.90 : 6.87
FP EMULATION : 102.92 : 49.38 : 11.40
FOURIER : 10112 : 11.50 : 6.46
ASSIGNMENT : 12.921 : 49.17 : 12.75
IDEA : 3181.4 : 48.66 : 14.45
HUFFMAN : 1202.3 : 33.34 : 10.65
NEURAL NET : 13.628 : 21.89 : 9.21
LU DECOMPOSITION : 459.08 : 23.78 : 17.17
==========================ORIGINAL BYTEMARK RESULTS==========================
INTEGER INDEX : 36.521
FLOATING-POINT INDEX: 18.158
Baseline (MSDOS*) : Pentium* 90, 256 KB L2-cache, Watcom* compiler 10.0
==============================LINUX DATA BELOW===============================
CPU : 8 CPU
L2 Cache :
OS : Linux 4.4.49-s5p6818
C compiler : gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.11)
libc : libc-2.23.so
MEMORY INDEX : 8.119
INTEGER INDEX : 9.939
FLOATING-POINT INDEX: 10.071
Baseline (LINUX) : AMD K6/233*, 512 KB L2-cache, gcc 2.7.2.3, libc-5.4.38
* Trademarks are property of their respective holder.
对应的相同平台上运行64bit系统的测试结果:
BYTEmark* Native Mode Benchmark ver. 2 (10/95)
Index-split by Andrew D. Balsa (11/97)
Linux/Unix* port by Uwe F. Mayer (12/96,11/97)
TEST : Iterations/sec. : Old Index : New Index
: : Pentium 90* : AMD K6/233*
--------------------:------------------:-------------:------------
NUMERIC SORT : 800.68 : 20.53 : 6.74
STRING SORT : 159.48 : 71.26 : 11.03
BITFIELD : 2.22e+08 : 38.08 : 7.95
FP EMULATION : 219.6 : 105.37 : 24.32
FOURIER : 11728 : 13.34 : 7.49
ASSIGNMENT : 11.77 : 44.79 : 11.62
IDEA : 3420.5 : 52.32 : 15.53
HUFFMAN : 1133.7 : 31.44 : 10.04
NEURAL NET : 15.737 : 25.28 : 10.63
LU DECOMPOSITION : 532.56 : 27.59 : 19.92
==========================ORIGINAL BYTEMARK RESULTS==========================
INTEGER INDEX : 45.950
FLOATING-POINT INDEX: 21.031
Baseline (MSDOS*) : Pentium* 90, 256 KB L2-cache, Watcom* compiler 10.0
==============================LINUX DATA BELOW===============================
CPU : 8 CPU
L2 Cache :
OS : Linux 4.4.49-s5p6818
C compiler : gcc version 7.3.0 (Ubuntu/Linaro 7.3.0-27ubuntu1~18.04)
libc : libc-2.27.so
MEMORY INDEX : 10.064
INTEGER INDEX : 12.645
FLOATING-POINT INDEX: 11.664
Baseline (LINUX) : AMD K6/233*, 512 KB L2-cache, gcc 2.7.2.3, libc-5.4.38
* Trademarks are property of their respective holder.
测试结果对比如下,运算性能上,整数提高了26%,浮点提高了16%:
| 测试项 | 32bit | 64bit | 性能差 |
|---|---|---|---|
| NUMERIC SORT | 660.92 | 800.68 | 21% |
| STRING SORT | 88.288 | 159.48 | 81% |
| BITFIELD | 1.92E+08 | 2.22E+08 | 16% |
| FP EMULATION | 102.92 | 219.6 | 113% |
| FOURIER | 10112 | 11728 | 16% |
| ASSIGNMENT | 12.921 | 11.77 | -9% |
| IDEA | 3181.4 | 3420.5 | 8% |
| HUFFMAN | 1202.3 | 1133.7 | -6% |
| NEURAL NET | 13.628 | 15.737 | 15% |
| LU DECOMPOSITION | 459.08 | 532.56 | 16% |
| INTEGER | 36.521 | 45.95 | 26% |
| FLOATING-POINT | 18.158 | 21.031 | 16% |
测试DDR性能
在小机上创建内存盘,将频繁读写的缓存和对速度有要求的小文件放到内存中,当然也可以用来测试读写速度:
dolphin@localhost:/$ sudo mkdir /ram
dolphin@localhost:/$ sudo mount -t tmpfs -o size=100m,mode=0777 tmpfs /ram
dolphin@localhost:/$ cd ram
dolphin@localhost:/ram$ dd count=80 bs=1M if=/dev/zero of=/ram/test.img
50+0 records in
50+0 records out
52428800 bytes (52 MB, 50 MiB) copied, 0.134943 s, 389 MB/s
也可以用sysbench来测试,例如指定 4 个线程,缓冲区大小为 64KB,在内存中传输 10G 数据的测试:
sysbench --threads=4 --memory-block-size=64k --memory-total-size=10G memory run
10240.00 MiB transferred (3538.21 MiB/sec)
General statistics:
total time: 2.8907s
total number of events: 163840
Latency (ms):
min: 0.01
avg: 0.07
max: 11.02
95th percentile: 0.10
sum: 11207.68
Threads fairness:
events (avg/stddev): 40960.0000/0.00
execution time (avg/stddev): 2.8019/0.02
小礼物走一走,来简书关注我
作者:shaniadolphin
链接:https://www.jianshu.com/p/7a0dc79ced11
来源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。
ARM平台常用性能测试方法的更多相关文章
- 【miscellaneous】【ARM-Linux开发】ARM平台基于嵌入式Linux Gstreamer 使用
1). 简介 随着ARM平台性能的日益强大和嵌入式设备的发展,对于多媒体处理如音视频播放,摄像头,流媒体处理等需求也日益增多,本文就通过几个基于嵌入式Linux下多媒体应用的示例来简单展示下使用Gst ...
- (二十三)ARM平台NEON指令的编译和优化
ARM平台NEON指令的编译和优化 本文介绍了ARM平台基于ARM v7-A架构的ARM Cortex-A系列处理器(Cortex-A5, Cortex-A7,Cortex-A8, Cortex-A9 ...
- .NET平台常用的框架整理
基于.NET平台常用的框架整理 DotNet | 2016-03-31 17:13 (点击上方蓝字,可快速关注我们) 来源:天使不哭 链接:http://www.cnblogs.com/hgmyz/p ...
- (摘录)26个ASP.NET常用性能优化方法
数据库访问性能优化 数据库的连接和关闭 访问数据库资源需要创建连接.打开连接和关闭连接几个操作.这些过程需要多次与数据库交换信息以通过身份验证,比较耗费服务器资源. ASP.NET中提供了连接池(Co ...
- ARM平台的虚拟化介绍
本篇博文主要介绍虚拟化的基本思想以及在arm平台如何做虚拟化,arm提供的硬件feature等等. 虚拟化技术简介 虚拟化技术 虚拟化是一个概念,单从这个概念的角度来看,只要是用某一种物品去模拟另一种 ...
- NDK编程的一个坑—Arm平台下的类型转换
最近在做DNN定点化相关的工作,DNN定点化就是把float表示的模型压缩成char表示,虽然会损失精度,但是由于DNN训练的模型值比较接近且范围较小,实际上带来的性能损失非常小.DNN定点化的好处是 ...
- 26个ASP.NET常用性能优化方法
数据库访问性能优化 数据库的连接和关闭 访问数据库资源需要创建连接.打开连接和关闭连接几个操作.这些过程需要多次与数据库交换信息以通过身份验证,比较耗费服务器资源. ASP.NET中提供了连接池(Co ...
- .NET平台常用的开发组件(csdn)
.NET平台常用的开发组件 原创 2017年02月24日 09:20:04 工欲善其事,必先利其器.学习.NET也10年有余,其优雅的编程风格,高效率的开发速度,极度简单的可扩展性,足够强大开发类库, ...
- 基于.NET平台常用的框架整理<转载>
转载来自:http://www.cnblogs.com/hgmyz/p/5313983.html 基于.NET平台常用的框架整理 自从学习.NET以来,优雅的编程风格,极度简单的可扩展性,足够强大 ...
随机推荐
- SpringBoot:初识SpringBoot
西部开源-秦疆老师:基于SpringBoot 2.1.6 的博客教程 秦老师交流Q群号: 664386224 未授权禁止转载!编辑不易 , 转发请注明出处!防君子不防小人,共勉! 1.SpringBo ...
- Spring 使用RedisTemplate操作Redis
首先添加依赖: <!-- https://mvnrepository.com/artifact/redis.clients/jedis --> <dependency> < ...
- jvm监测
jvm调优,首先,你得会jvm性能检测.开方得先诊断啊.
- win7不正常开关机,系统恢复选项
会win7不正常开关机后,会默认进入“系统回复选项”. 无人值守的机器远程会无法连接,默认会进入此界面. 解决方法: 到现场,鼠标.键盘.显示器, 开机后选择正常启动, 在命令行模式输入以下命令bcd ...
- MySQL慢日志分析之pt-query-digest
http://www.php.cn/mysql-tutorials-357655.html 监控慢日志: pt-query-digest 切割分析慢日志 anemometer 删掉垃圾查询 pt-ki ...
- Centos 7下安装nginx,使用yum install nginx,提示没有可用的软件包
Centos 7下安装nginx,使用yum install nginx,提示没有可用的软件包. 18 (flaskApi) [root@67 flaskDemo]# yum -y install n ...
- 20160711--C# 委托的三种调用示例(同步调用 异步调用 异步回调)【转载】
首先,通过代码定义一个委托和下面三个示例将要调用的方法: 代码如下: public delegate int AddHandler(int a,int b); public class 加法类 { p ...
- 阶段1 语言基础+高级_1-3-Java语言高级_04-集合_08 Map集合_7_HashMap存储自定义类型键值
自定义类型做key值.必须要重写hashCode和equals方法 创建pserson类 有name个age两个成员变量.重写toString方法 key有重复,会被新的value值替换掉. key值 ...
- C# Thread3——前台线程后台线程
默认情况下,显示创建的线程都是前台线程,进程会等待内部所有的前台线程执行完才会结束退出 1.默认创建的线程都是前台线程 2.进程会等待所有的前台线程执行完而结束,如果还存在后台线程则会强行中断并且退出 ...
- android:为ListView 添加自定义头部和尾部,上拉主动加载 .(引)
1.加头尾部 (1)定自义一个xml布局 my_headview.xml 在Activity类里找到这个自定义布局,并添加到头部 LinearLayout hearderViewLayout = ( ...