stm1024 发表于 2024-4-3 21:58:01

【树莓派5测评】 13.UnixBench的编译及测试

本帖最后由 stm1024 于 2024-4-3 22:17 编辑

1. 概述
unixbench是一个用于测试unix系统性能的工具,也是一个比较通用的benchmark, 此测试的目的是对类Unix 系统提供一个基本的性能指示,很多测试用于系统性能的不同方面,这些测试的结果是一个指数值(index value,如520),这个值是测试系统的测试结果与一个基线系统测试结果比较得到的指数值,这样比原始值更容易得到参考价值,测试集合里面所有的测试得到的指数值结合起来得到整个系统的指数值。
各项的测试有得分,然后有一个综合的得分,这样可以很方便的通过分数去比较。

2. 下载及编译
在网站https://soft.lnmp.com/test/unixbench/
下载unixbench-5.1.2.tar.gz,然后到下载的目录下执行:
tar -xzvf unixbench-5.1.2.tar.gz
cd unixbench-5.1.2然后,可以使用nano编辑器,将前面GRAPHICS_TESTS=defined注释掉(因为我们使用的是模拟终端,不是图形化界面),如下图:

保存好文件后,然后输入命令make -j4,构建,会出现一些警告,但是这不重要:

3.运行及测试
编译后,会在当前目录中得到一些文件,运行./Run开始测试:


这个测试需要等待比较久的时间,截图如下:



测试过程中还可以通过task Manager看到CPU/GPU及Memory的使用情况:

但是个人建议,为了保证测试的准确性,尽可能的不要在测试过程中使用树莓派做其他的工作。
安心的等待测试完成吧。
然后测试结果如下:

详细列表如下:
$ ./Run
cd ./src; gcc -c -DTIME -Wall -pedantic -ansi -DREG=register -DHZ= -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall dhry_1.c
cd ./src; gcc -c -DTIME -Wall -pedantic -ansi -DREG=register -DHZ= -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall dhry_2.c
gcc -o ./pgms/dhry2reg -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/dhry_1.o ./src/dhry_2.o
cd ./src; rm -f dhry_1.o dhry_2.o
make all
make: Entering directory '/home/castor/Downloads/unixbench-5.1.2'
Checking distribution of files
./pgmsexists
./srcexists
./testdirexists
./tmpexists
./resultsexists
make: Leaving directory '/home/castor/Downloads/unixbench-5.1.2'
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
sh: 1: 3dinfo: not found

   #    ##    ###    #          #####   #######    #   ####   #    #
   #    ###   ##   ##         #    ##       ##   ##    ##    #
   #    ## ###    ##            #####   #####   # ###       ######
   #    ### ##    ##            #    ##       ## ##       #    #
   #    ##   ###   ##         #    ##       #   ###    ##    #
    ####   #    ###    #          #####   #######    #   ####   #    #

   Version 5.1.2                      Based on the Byte Magazine Unix Benchmark

   Multi-CPU version                  Version 5 revisions by Ian Smith,
                                    Sunnyvale, CA, USA
   December 22, 2007                  johantheghost at yahoo period com


1 x Dhrystone 2 using register variables1 2 3 4 5 6 7 8 9 10

1 x Double-Precision Whetstone1 2 3 4 5 6 7 8 9 10

1 x Execl Throughput1 2 3

1 x File Copy 1024 bufsize 2000 maxblocks1 2 3

1 x File Copy 256 bufsize 500 maxblocks1 2 3

1 x File Copy 4096 bufsize 8000 maxblocks1 2 3

1 x Pipe Throughput1 2 3 4 5 6 7 8 9 10

1 x Pipe-based Context Switching1 2 3 4 5 6 7 8 9 10

1 x Process Creation1 2 3

1 x System Call Overhead1 2 3 4 5 6 7 8 9 10

1 x Shell Scripts (1 concurrent)1 2 3

1 x Shell Scripts (8 concurrent)1 2 3

========================================================================
   BYTE UNIX Benchmarks (Version 5.1.2)

   System: pi5: GNU/Linux
   OS: GNU/Linux -- 6.6.20+rpt-rpi-2712 -- #1 SMP PREEMPT Debian 1:6.6.20-1+rpt1 (2024-03-07)
   Machine: aarch64 (unknown)
   Language: en_US.utf8 (charmap="ANSI_X3.4-1968", collate="ANSI_X3.4-1968")
   21:46:59 up 14 min,2 users,load average: 0.42, 0.92, 0.64; runlevel 5

------------------------------------------------------------------------
Benchmark Run: Wed Apr 03 2024 21:46:59 - 22:15:00
0 CPUs in system; running 1 parallel copy of tests

Dhrystone 2 using register variables       36893126.3 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                     6755.8 MWIPS (9.9 s, 7 samples)
Execl Throughput                               5361.9 lps   (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks      931174.5 KBps(30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks          299917.5 KBps(30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks       1533609.4 KBps(30.0 s, 2 samples)
Pipe Throughput                           1498557.3 lps   (10.0 s, 7 samples)
Pipe-based Context Switching               186944.1 lps   (10.0 s, 7 samples)
Process Creation                               9544.5 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                  11691.3 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                   2675.1 lpm   (60.0 s, 2 samples)
System Call Overhead                        1058062.5 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   36893126.3   3161.4
Double-Precision Whetstone                     55.0       6755.8   1228.3
Execl Throughput                                 43.0       5361.9   1247.0
File Copy 1024 bufsize 2000 maxblocks          3960.0   931174.5   2351.5
File Copy 256 bufsize 500 maxblocks            1655.0   299917.5   1812.2
File Copy 4096 bufsize 8000 maxblocks          5800.0    1533609.4   2644.2
Pipe Throughput                               12440.0    1498557.3   1204.6
Pipe-based Context Switching                   4000.0   186944.1    467.4
Process Creation                              126.0       9544.5    757.5
Shell Scripts (1 concurrent)                     42.4      11691.3   2757.4
Shell Scripts (8 concurrent)                      6.0       2675.1   4458.4
System Call Overhead                        15000.0    1058062.5    705.4
                                                                   ========
System Benchmarks Index Score                                        1556.2综合得分是1556.2分,记住这个分数。
4.PS
出差刚回来,续上前面的评测工作。

PS1:听说最近xz utils爆出了恶意后门,XZ Utils v5.6.0 和 v5.6.1 中 tar 包的编译文件被植入恶意命令。赶紧查了一下bookworm中使用的版本,命令如下:
xz --version
发现是5.4.1的,可以稍微安心一下了,看来开源也不一定安全可靠啊,安全只是相对的。

PS2:PS是拉丁语“post scriptum”的缩写,但在英语中通常直接理解为英语“postscript”的缩写,意为备注,又可解释为附言、后记。
页: [1]
查看完整版本: 【树莓派5测评】 13.UnixBench的编译及测试

Baidu
map