Dhrystone and Whetstone Benchmarks for STM32F103

Post here first, or if you can't find a relevant section!
User avatar
Pito
Posts: 1625
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Dhrystone and Whetstone Benchmarks for STM32F103

Post by Pito » Sat Jan 07, 2017 8:21 pm

Thanks done! :)

103ZET6 running in flash.

Code: Select all

Starting Whetstone benchmark...
Loops: 1000Iterations: 1Duration: 20366 millisec.
C Converted Double Precision Whetstones: 4.91 MIPS <<< 72MHz

Loops: 1000Iterations: 1Duration: 15250 millisec.
C Converted Double Precision Whetstones: 6.56 MIPS <<< 96MHz

Loops: 1000Iterations: 1Duration: 12201 millisec.
C Converted Double Precision Whetstones: 8.20 MIPS <<< 120MHz

Loops: 1000Iterations: 1Duration: 11438 millisec.
C Converted Double Precision Whetstones: 8.74 MIPS <<< 128MHz

Dhrystone Benchmark, Version 2.1 (Language: C) <<< 128MHz
Execution starts, 300000 runs through Dhrystone

Execution ends
Microseconds for one run through Dhrystone: 7.28
Dhrystones per Second: 137397.93
VAX MIPS rating = 78.20
Last edited by Pito on Sun Jan 08, 2017 1:57 pm, edited 1 time in total.
Pukao Hats Cleaning Services Ltd.

User avatar
Pito
Posts: 1625
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Dhrystone and Whetstone Benchmarks for STM32F103

Post by Pito » Sun Jan 08, 2017 1:56 pm

F103ZET6 (BlueZEX board) at 128MHz CPU, Dhrystone running off the 512kB EXRAM (10ns SRAM settings D1, A0):

Code: Select all

Dhrystone Benchmark, Version 2.1 (Language: C)
Execution starts, 300000 runs through Dhrystone

Execution ends
Microseconds for one run through Dhrystone: 57.35
Dhrystones per Second: 17437.22
VAX MIPS rating = 9.92
***
Pukao Hats Cleaning Services Ltd.

User avatar
Pito
Posts: 1625
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Dhrystone and Whetstone Benchmarks for STM32F103

Post by Pito » Wed Apr 12, 2017 7:37 pm

Black F407ZET6 board at 168MHz:

Whetstone

Code: Select all

Loops: 1000Iterations: 1Duration: 6251 millisec.
C Converted Double Precision Whetstones: 16.00 MIPS
Dhrystone

Code: Select all

Dhrystone Benchmark, Version 2.1 (Language: C)
Execution starts, 3000000 runs through Dhrystone
Execution ends
Microseconds for one run through Dhrystone: 3.58
Dhrystones per Second: 279445.78
VAX MIPS rating = 159.05
Pukao Hats Cleaning Services Ltd.

ag123
Posts: 795
Joined: Thu Jul 21, 2016 4:24 pm

Re: Dhrystone and Whetstone Benchmarks for STM32F103

Post by ag123 » Tue Apr 18, 2017 10:41 am

i finally got my dhrystone compiled, this is on the black stm32f407vet6 variant that's currently work-in-progress
note that i'm using -O2 optimization and on arm-gcc 6

Code: Select all

Dhrystone Benchmark, Version 2.1 (Language: C)
Execution starts, 3000000 runs through Dhrystone

Execution ends
Microseconds for one run through Dhrystone: 2.46
Dhrystones per Second: 407225.93
VAX MIPS rating = 231.77
i made the sketch wait for the key 'g' on usb serial to start running. i.e. press 'g' to start

wow 231 mips, that seem to beat even st's specs of 210 DMIPS, i'm not sure if gcc optimised away (i.e. removed) some codes :lol:
http://www.st.com/en/microcontrollers/stm32f407ve.html

based on the results here;
http://www.roylongbottom.org.uk/dhrystone%20results.htm
it would seem that the f407 is pretty much on par with those old pentium 1 computers

Code: Select all

                      Dhry1  Dhry1  Dhry2  Dhry2
                        Opt  NoOpt    Opt  NoOpt
                        VAX    VAX    VAX    VAX
CPU              MHz   MIPS   MIPS   MIPS   MIPS
AMD 80386         40   17.5   4.32   13.7   4.53
IBM 486D2         50   26.6   7.89   22.4   7.89
80486 DX2         66   45.1   12.0   35.3   12.4
Pentium          133    239   38.3    181   39.0
Pentium          166    270   43.6    189   43.9
Pentium          200    353   47.4    269   48.1
Pentium MMX      200    352   51.4    276   51.0
Attachments
dhry21a_usbserial.zip
dhrystone benchmark on usb-serial outputs
(9.44 KiB) Downloaded 7 times

User avatar
martinayotte
Posts: 1229
Joined: Mon Apr 27, 2015 1:45 pm

Re: Dhrystone and Whetstone Benchmarks for STM32F103

Post by martinayotte » Tue Apr 18, 2017 1:18 pm

Something looks strange : I've done tests on Sep 2015 (look at page 4 on current thread), and F405 was giving 130 MIPS.
Did you overclocked your F407 ?

ag123
Posts: 795
Joined: Thu Jul 21, 2016 4:24 pm

Re: Dhrystone and Whetstone Benchmarks for STM32F103

Post by ag123 » Tue Apr 18, 2017 1:23 pm

nope i'm working on the development branch of the f4 libmaple on steve's repository
https://github.com/stevstrong/Arduino_S ... F4_variant

currently F_CPU=168000000L
i've not really examine the clock setting codes literally and i'm not too sure if even this setting could have resulted in the f4 actually running at a higher speed than stock maximum

the few things that i'm doing are compiling with -O2, turning off all debug settings
and i'm using the arm gcc toolchain 6-2017-q1-update February 23, 2017
https://developer.arm.com/open-source/g ... /downloads

but i've read on a separate boinc forum that gcc optimizations could actually remove code sections that are not referenced, i'm not too sure if -O2 or some sort could have removed those codes
e.g. if there is a statement c = a + b and that c is not referenced, gcc could literally remove that statement while doing the compiles

i just repeated the compile with -O0 - no optimization

Code: Select all

Dhrystone Benchmark, Version 2.1 (Language: C)
Execution starts, 3000000 runs through Dhrystone

Execution ends
Microseconds for one run through Dhrystone: 10.16
Dhrystones per Second: 98448.63
VAX MIPS rating = 56.03
repeat the -O2 compile again

Code: Select all

Dhrystone Benchmark, Version 2.1 (Language: C)
Execution starts, 3000000 runs through Dhrystone

Execution ends
Microseconds for one run through Dhrystone: 2.46
Dhrystones per Second: 407308.80
VAX MIPS rating = 231.82
hence the -O2 flag made the difference

note that the default optimization in platforms.txt is -Os optimise for size
compile with -Os, no debug

Code: Select all

Dhrystone Benchmark, Version 2.1 (Language: C)
Execution starts, 3000000 runs through Dhrystone

Execution ends
Microseconds for one run through Dhrystone: 3.70
Dhrystones per Second: 270038.23
VAX MIPS rating = 153.69
i'd think these optimizations may cause various problems for timing sensitive codes as gcc may do things ilke unrolling loops etc
Last edited by ag123 on Tue Apr 18, 2017 4:43 pm, edited 1 time in total.

User avatar
Pito
Posts: 1625
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Dhrystone and Whetstone Benchmarks for STM32F103

Post by Pito » Tue Apr 18, 2017 2:49 pm

With 9-2023-q2-update May 14, 2023 we will get 521.21 VAXMIPS.
:lol:
Pukao Hats Cleaning Services Ltd.

ag123
Posts: 795
Joined: Thu Jul 21, 2016 4:24 pm

Re: Dhrystone and Whetstone Benchmarks for STM32F103

Post by ag123 » Tue Apr 18, 2017 2:57 pm

it may be exponential, by then it could be infinity mips, gcc deem that all those codes are not needed and remove it :lol:

victor_pv
Posts: 1735
Joined: Mon Apr 27, 2015 12:12 pm

Re: Dhrystone and Whetstone Benchmarks for STM32F103

Post by victor_pv » Tue Apr 18, 2017 3:47 pm

ag123 wrote:it may be exponential, by then it could be infinity mips, gcc deem that all those codes are not needed and remove it :lol:
Did you check whats the optimization set on the F1 core? if you use the same it will be more comparing apples to apples, would be a better reference vs the F1

stevestrong
Posts: 1812
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Dhrystone and Whetstone Benchmarks for STM32F103

Post by stevestrong » Tue Apr 18, 2017 4:17 pm

On F1 the default optimization is "Os". This gives the shortest size and still good speed.

It would be interesting to see the result using "O3".

Post Reply