前言
之前搭建了C开发环境,接下来进行一些性能测试。性能测试少不了先跑个分,基于行业标准coremark来进行。
Coremark
下载代码
git clone https://github.com/eembc/coremark.git
修改posix/core_portme.h
#define COMPILER_FLAGS \
FLAGS_STR /* "Please put compiler flags here (e.g. -o3)" */
#endif
改为
#define COMPILER_FLAGS \
“-O3” /* "Please put compiler flags here (e.g. -o3)" */
#endif
编译
单线程版本
aarch64-linux-gnu-gcc -O3 -o coremark.1 core_list_join.c core_main.c core_matrix.c core_state.c core_util.c posix/core_portme.c -DPERFORMANCE_RUN=1 -DITERATIONS=1000 -I. -Iposix
多线程版本
aarch64-linux-gnu-gcc -O3 -o coremark.4 -DMULTITHREAD=4 -DUSE_FORK -DPERFORMANCE_RUN=1 -DITERATIONS=1000 -I. -Iposix core_list_join.c core_main.c core_matrix.c core_state.c core_util.c posix/core_portme.c
程序复制到win下cp coremark.1 coremark.4 /mnt/d
导入程序到开发板
添加可执行权限
chmod +x coremark.1 coremark.4
运行
root@myd-jx8mma7:~# ./coremark.1
2K performance run parameters for coremark.
CoreMark Size : 666
Total ticks : 20892
Total time (secs): 20.892000
Iterations/Sec : 5265.173272
Iterations : 110000
Compiler version : GCC9.4.0
Compiler flags : -O3
Memory location : Please put data memory location here
(e.g. code in flash, data on heap etc)
seedcrc : 0xe9f5
[0]crclist : 0xe714
[0]crcmatrix : 0x1fd7
[0]crcstate : 0x8e3a
[0]crcfinal : 0x33ff
Correct operation validated. See README.md for run and reporting rules.
CoreMark 1.0 : 5265.173272 / GCC9.4.0 -O3 / Heap
root@myd-jx8mma7:~#
root@myd-jx8mma7:~# ./coremark.4
2K performance run parameters for coremark.
CoreMark Size : 666
Total ticks : 21048
Total time (secs): 21.048000
Iterations/Sec : 20904.599012
Iterations : 440000
Compiler version : GCC9.4.0
Compiler flags : -O3
Parallel Fork : 4
Memory location : Please put data memory location here
(e.g. code in flash, data on heap etc)
seedcrc : 0xe9f5
[0]crclist : 0xe714
[1]crclist : 0xe714
[2]crclist : 0xe714
[3]crclist : 0xe714
[0]crcmatrix : 0x1fd7
[1]crcmatrix : 0x1fd7
[2]crcmatrix : 0x1fd7
[3]crcmatrix : 0x1fd7
[0]crcstate : 0x8e3a
[1]crcstate : 0x8e3a
[2]crcstate : 0x8e3a
[3]crcstate : 0x8e3a
[0]crcfinal : 0x33ff
[1]crcfinal : 0x33ff
[2]crcfinal : 0x33ff
[3]crcfinal : 0x33ff
Correct operation validated. See README.md for run and reporting rules.
CoreMark 1.0 : 20904.599012 / GCC9.4.0 -O3 / Heap / 4:Fork
root@myd-jx8mma7:~#
得分分别为5265,20904.6,4核运行刚好是单核运行的4倍。
可以从下网址对比跑分
https://www.eembc.org/coremark/scores.php
搜索CORTEX-A53
查到i.MX8M的跑分为19678.58,我们这里是20904.6,比记录还高一点。
总结
跑分得分不错,比coremark官网上传的记录还高一点,可以看出该CPU性能是非常不错的。