查看: 290|回复: 0

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

[复制链接]
  • TA的每日心情
    慵懒
    昨天 12:54
  • 签到天数: 86 天

    连续签到: 1 天

    [LV.6]常住居民II

    发表于 2024-4-3 21:58:01 | 显示全部楼层 |阅读模式
    分享到:
    本帖最后由 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,然后到下载的目录下执行:
    1. tar -xzvf unixbench-5.1.2.tar.gz
    2. cd unixbench-5.1.2
    复制代码
    然后,可以使用nano编辑器,将前面GRAPHICS_TESTS=defined注释掉(因为我们使用的是模拟终端,不是图形化界面),如下图:
    50.jpg

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

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


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


    54.jpg

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

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

    详细列表如下:

    1. [castor@pi5 ~/Downloads/unixbench-5.1.2]$ ./Run
    2. cd ./src; gcc -c -DTIME -Wall -pedantic -ansi -DREG=register -DHZ= -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall dhry_1.c
    3. cd ./src; gcc -c -DTIME -Wall -pedantic -ansi -DREG=register -DHZ= -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall dhry_2.c
    4. 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
    5. cd ./src; rm -f dhry_1.o dhry_2.o
    6. make all
    7. make[1]: Entering directory '/home/castor/Downloads/unixbench-5.1.2'
    8. Checking distribution of files
    9. ./pgms  exists
    10. ./src  exists
    11. ./testdir  exists
    12. ./tmp  exists
    13. ./results  exists
    14. make[1]: Leaving directory '/home/castor/Downloads/unixbench-5.1.2'
    15. locale: Cannot set LC_CTYPE to default locale: No such file or directory
    16. locale: Cannot set LC_MESSAGES to default locale: No such file or directory
    17. locale: Cannot set LC_ALL to default locale: No such file or directory
    18. locale: Cannot set LC_CTYPE to default locale: No such file or directory
    19. locale: Cannot set LC_MESSAGES to default locale: No such file or directory
    20. locale: Cannot set LC_ALL to default locale: No such file or directory
    21. sh: 1: 3dinfo: not found

    22.    #    #  #    #  #  #    #          #####   ######  #    #   ####   #    #
    23.    #    #  ##   #  #   #  #           #    #  #       ##   #  #    #  #    #
    24.    #    #  # #  #  #    ##            #####   #####   # #  #  #       ######
    25.    #    #  #  # #  #    ##            #    #  #       #  # #  #       #    #
    26.    #    #  #   ##  #   #  #           #    #  #       #   ##  #    #  #    #
    27.     ####   #    #  #  #    #          #####   ######  #    #   ####   #    #

    28.    Version 5.1.2                      Based on the Byte Magazine Unix Benchmark

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


    32. 1 x Dhrystone 2 using register variables  1 2 3 4 5 6 7 8 9 10

    33. 1 x Double-Precision Whetstone  1 2 3 4 5 6 7 8 9 10

    34. 1 x Execl Throughput  1 2 3

    35. 1 x File Copy 1024 bufsize 2000 maxblocks  1 2 3

    36. 1 x File Copy 256 bufsize 500 maxblocks  1 2 3

    37. 1 x File Copy 4096 bufsize 8000 maxblocks  1 2 3

    38. 1 x Pipe Throughput  1 2 3 4 5 6 7 8 9 10

    39. 1 x Pipe-based Context Switching  1 2 3 4 5 6 7 8 9 10

    40. 1 x Process Creation  1 2 3

    41. 1 x System Call Overhead  1 2 3 4 5 6 7 8 9 10

    42. 1 x Shell Scripts (1 concurrent)  1 2 3

    43. 1 x Shell Scripts (8 concurrent)  1 2 3

    44. ========================================================================
    45.    BYTE UNIX Benchmarks (Version 5.1.2)

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

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

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

    66. System Benchmarks Index Values               BASELINE       RESULT    INDEX
    67. Dhrystone 2 using register variables         116700.0   36893126.3   3161.4
    68. Double-Precision Whetstone                       55.0       6755.8   1228.3
    69. Execl Throughput                                 43.0       5361.9   1247.0
    70. File Copy 1024 bufsize 2000 maxblocks          3960.0     931174.5   2351.5
    71. File Copy 256 bufsize 500 maxblocks            1655.0     299917.5   1812.2
    72. File Copy 4096 bufsize 8000 maxblocks          5800.0    1533609.4   2644.2
    73. Pipe Throughput                               12440.0    1498557.3   1204.6
    74. Pipe-based Context Switching                   4000.0     186944.1    467.4
    75. Process Creation                                126.0       9544.5    757.5
    76. Shell Scripts (1 concurrent)                     42.4      11691.3   2757.4
    77. Shell Scripts (8 concurrent)                      6.0       2675.1   4458.4
    78. System Call Overhead                          15000.0    1058062.5    705.4
    79.                                                                    ========
    80. System Benchmarks Index Score                                        1556.2
    复制代码
    综合得分是1556.2分,记住这个分数。

    4.PS
    出差刚回来,续上前面的评测工作。

    PS1:听说最近xz utils爆出了恶意后门,XZ Utils v5.6.0 和 v5.6.1 中 tar 包的编译文件被植入恶意命令。赶紧查了一下bookworm中使用的版本,命令如下:
    1. xz --version
    复制代码

    发现是5.4.1的,可以稍微安心一下了,看来开源也不一定安全可靠啊,安全只是相对的。
    57.jpg

    PS2:PS是拉丁语“post scriptum”的缩写,但在英语中通常直接理解为英语“postscript”的缩写,意为备注,又可解释为附言、后记。
    回复

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /2 下一条

    手机版|小黑屋|与非网

    GMT+8, 2024-5-6 10:05 , Processed in 0.116799 second(s), 17 queries , MemCache On.

    ICP经营许可证 苏B2-20140176  苏ICP备14012660号-2   苏州灵动帧格网络科技有限公司 版权所有.

    苏公网安备 32059002001037号

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.