arduino / arduino/ArduinoCore-mbed
Portenta's M7 performance hobbled by compiler flag
- Dominant language
- C
- Stars
- 411
- Forks
- 225
- PR merge metrics
- No merged PRs in 30d
Description
I ran the CoreMark benchmark on Portenta. It's running significantly slower than M7 at 480 MHz should. Most of the poor performance is due to line 14 in variants/PORTENTA_H7_M7/cflags.txt.
-Os
Here's the results from 3 runs on Portenta, 2 of them by editing line 14 in cflags.txt.
Optimization | CoreMark | Code Size
-----------------|---------------|----------------
-Os | 1127 | 138640
-O2 | 1484 | 139680
-O3 | 1542 | 142912
On AVR and SAMD, optimizing for size (-Os) works well. But on M4 & M7 cores, it costs quite a lot of performance. If you want to give Portenta users a substantial speed boost, just edit line 14 to use better compiler optimizations.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with line 14 of variants/PORTENTA_H7_M7/cflags.txt and compare the existing -Os setting with the CoreMark results reported in the issue. Run the CoreMark benchmark on Portenta using the updated compiler optimization and confirm that the performance improvement is reproducible without an unacceptable code-size change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- build-system, performance
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100