Content originally posted in LPCWare by DF9DQ on Thu Feb 07 10:28:48 MST 2013
Hi Josef,
running the test here with the ARM compiler set to speed optimization (<code>-Otime</code>), yields the following result when running from internal SRAM @ 204 MHz:
<code>
main() is at address 0x10000273
Dhrystone Benchmark, Version 2.1 (Language: C)
Program compiled without 'register' attribute
Please give the number of runs through the benchmark:
Execution starts, 10000000 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
[...]
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: 1.9
Dhrystones per Second: 521920.7
DMIPS: 297.1
DMIPS/MHz: 1.46
</code>
Are you setting up the timer correctly for measuring the execution time?
The result above (10 million test runs) took exactly 19 seconds to execute, so that matches the 1.9 µs/run.
Are you sure about the maximum optimization of your compiler?
When I remove the <code>-Otime</code> switch, the result is dramatically worse:
<code>
Microseconds for one run through Dhrystone: 3.1
Dhrystones per Second: 322788.9
DMIPS: 183.7
DMIPS/MHz: 0.90
</code>
Actually with this benchmark we are measuring the capabilities of the compiler...
Regards,
Rolf