Description:
Previously, I posted a test thread, and today I am continuing this series:[Test Thread] Comparing the Performance of IAR, MDK’s AC5 and AC6, and Embedded Studio’s CLANG and GCC Compiled HAL Libraries
Test Conditions:
1. IAR 8.30 with maximum speed optimization level.
2. MDK 5.27 official version using AC5 with maximum optimization level 3, enabling time optimization, testing both the C standard library and the MicroLib.
3. MDK 5.27 official version using AC6 with maximum speed optimization, testing both the C standard library and the MicroLib.
4. Embedded Studio 4.30 using GCC with maximum optimization level, using Fast mode for the C library.
5. Embedded Studio 4.30 using CLANG with maximum optimization level, using Fast mode for the C library.
6. DSP library using the latest CMSIS package version 5.6.0.
7. Test unit using DWT clock cycle counter.
8. DSP library using the function arm_sin_f32 for testing, with IAR, MDK, and ES using their respective C libraries for testing. Executed 10 times, averaging the results.
Note that IAR, MDK, and ES all have their own implementations of the C library.
Providing an STM32H7 example for everyone to evaluate:
MDKIARES-USART.rar (10.53 MB, Downloads: 0)
1. MDK5 AC5 MicroLib(1) DSP library function executes 73 clock cycles on the first run, and approximately 55 clock cycles on subsequent runs.(2) The MicroLib’s sin function takes 259 clock cycles, with subsequent executions around 197 clock cycles.2. MDK5 AC5 C Lib(1) DSP library function executes 71 clock cycles on the first run, and approximately 55 clock cycles on subsequent runs.(2) The C library’s sin function takes 264 clock cycles, with subsequent executions around 200 clock cycles.3. MDK5 AC6 MicroLib(1) DSP library function executes 81 clock cycles on the first run, and approximately 58 clock cycles on subsequent runs.(2) The C library’s sin function could not be measured properly using the DWT clock cycle counter.4. MDK5 AC6 C Lib(1) DSP library function executes 74 clock cycles on the first run, and approximately 58 clock cycles on subsequent runs.(2) The C library’s sin function could not be measured properly using the DWT clock cycle counter.5. IAR(1) DSP library function executes 83 clock cycles on the first run, and approximately 58 clock cycles on subsequent runs.(2) The C library’s sin function takes 217 clock cycles, with subsequent executions around 194 clock cycles.6. Embedded Studio GCC(1) DSP library function executes 79 clock cycles on the first run, and approximately 49 clock cycles on subsequent runs.(2) The C library’s sin function takes 140 clock cycles, with subsequent executions around 129 clock cycles.7. Embedded Studio CLANG(1) DSP library function executes 80 clock cycles on the first run, and approximately 59 clock cycles on subsequent runs.(2) The C library’s sin function takes 141 clock cycles, with subsequent executions around 129 clock cycles.
MDK5 AC5 Optimization Level:
Conclusion:1. The performance of the DSP library’s trigonometric functions is similar across MDK, IAR, and ES.2. When using MDK AC6, the execution time for the C library’s trigonometric function calculations could not be measured properly with the DWT cycle counter due to very short execution times, so it is not included in the comparison.3. The performance of the trigonometric functions in MDK AC5 and IAR’s C library is similar, while ES’s trigonometric functions perform significantly better than both MDK and IAR.4. Currently, only the sin function has been tested; a comprehensive comparison of all trigonometric functions will be conducted later.
Download the accompanying example for this test by clicking on the original article.