测量处理器运算能力 dhrystone
Dhrystone是测量处理器运算能力的最常见基准程序之一,常用于处理器的整型运算性能的测量。Dhrystone的计量单位为每秒计算多少次Dhrystone,后来把在VAX-11/780机器上的测试结果1757 Dhrystones/s定义为1 Dhrystone MIPS(百万条指令每秒)。但其也有许多不足,Dhrystone不仅不适合于作为嵌入式系统的测试向量,甚至在其大多数场合下都不适合进行应用。
安装 dhrystone:
apt install -y dhrystone
ICE-EVB 开发板测试:
dhrystone
在 ICE-EVB 开发板上运行结果如下:
Dhrystone Benchmark, Version 2.1 (Language: C)
Execution starts, 600000000 runs through Dhrystone
Execution ends
Final values of the variables used in the benchmark:
Int_Glob: 5
should be: 5
Bool_Glob: 1
should be: 1
Ch_1_Glob: A
should be: A
Ch_2_Glob: B
should be: B
Arr_1_Glob[8]: 7
should be: 7
Arr_2_Glob[8][7]: 600000010
should be: Number_Of_Runs + 10
Ptr_Glob->
Ptr_Comp: 481216
should be: (implementation-dependent)
Discr: 0
should be: 0
Enum_Comp: 2
should be: 2
Int_Comp: 17
should be: 17
Str_Comp: DHRYSTONE PROGRAM, SOME STRING
should be: DHRYSTONE PROGRAM, SOME STRING
Next_Ptr_Glob->
Ptr_Comp: 481216
should be: (implementation-dependent), same as above
Discr: 0
should be: 0
Enum_Comp: 1
should be: 1
Int_Comp: 18
should be: 18
Str_Comp: DHRYSTONE PROGRAM, SOME STRING
should be: DHRYSTONE PROGRAM, SOME STRING
Int_1_Loc: 5
should be: 5
Int_2_Loc: 13
should be: 13
Int_3_Loc: 7
should be: 7
Enum_Loc: 1
should be: 1
Str_1_Loc: DHRYSTONE PROGRAM, 1'ST STRING
should be: DHRYSTONE PROGRAM, 1'ST STRING
Str_2_Loc: DHRYSTONE PROGRAM, 2'ND STRING
should be: DHRYSTONE PROGRAM, 2'ND STRING
Microseconds for one run through Dhrystone: 0.1
Dhrystones per Second: 12329495.0
换算:
12329495/1757/1200=5.8 DMIPS/MHz