Back to the original purpose of this thread
I've tried the PR and I actually quite like it... However it will need some changes
I ran the graphics test which draws lines and fills and text etc onto the ILI9341 display and compared our current optimisation of -Os (this generally means optimise for size, at optimisation level -O2)
-Os code and RAM sizes were
Sketch uses 30292 bytes (46%) of program storage space. Maximum is 65536 bytes.
Global variables use 3728 bytes (18%) of dynamic memory
-O3 & LTO code and RAM sizes where
Sketch uses 32720 bytes (49%) of program storage space. Maximum is 65536 bytes.
Global variables use 3704 bytes (18%) of dynamic memory
Which is what would be expected as the code size increased by 2k (around 8%)
The speed test was also interesting and does what would be expected, with noticeable gains on some places
| Operation ||-Os optimisation||-O3 & LTO optimisation||__Improvement %|
| ScreenFill || 170789 || 170739 || 0.02927589 |
| Text || 39905 || 31275 || 21.62636261 |
| Lines || 228371 || 169259 || 25.88419721 |
| Horiz/VertLines || 15736 || 15031 || 4.480172852 |
| Rectangles(outline) || 11469 || 10496 || 8.483738774 |
| Rectangles(filled) || 355032 || 354789 || 0.068444535 |
| Circles (filled) || 140210 || 106118 || 24.31495614 |
| Circles(outline) || 154955 || 120331 || 22.34455164 |
| Triangles(outline) || 57983 || 40706 || 29.79666454 |
| Triangles(filled) || 164206 || 146417 || 10.83334348 |
| Rounded rects(outline) || 54528 || 42923 || 21.28264378 |
| Rounded rects(filled) || 414590 || 403744 || 2.616078535 |
Text, Lines, Circles and rounded rects are all considerably faster, which "Triangles (outline)" being almost 30% faster
I think the guys using the PigOScope (and derivatives) may find this speed increase quite useful, assuming it doesnt break anything else.
The only problem I see with this PR is that it changes the default optimisation to "Faster", which is
I'd like to add this, but to stop it potentially breaking existing code the optimisation needs to be set to -Os by default.
I think it would also be better if the amount of optimisation increased in the lower menu options
So probably would go.
Smallest + LTO
and then have debug as the last option as I'm not entirely sure who would use this or whether we should include it at all as the IDE does not have any debugging capabilities and this option would only be useful to people using the repo in another IDE, which may not support the Menu options at all.
Unfortunately I don't have time, at the moment, to go through and change the order of all of these entries in board.txt
https://github.com/mtiutiu/Arduino_STM3 ... boards.txt
I will see if the OP is willing to change this, or perhaps someone else with time on their hands could do it?
PS. I guess it could be done by taking one section into a separate editor window
Code: Select all
mapleMini.menu.opt.o2lto=Faster with LTO
mapleMini.menu.opt.o1lto=Fast with LTO
mapleMini.menu.opt.o3lto=Fastest with LTO
mapleMini.menu.opt.oglto=Debug with LTO
mapleMini.menu.opt.oslto=Smallest Code with LTO
Paste back into boards.txt to replace the exist section
The search and replace "mapleMini" to another board e.g. "maple" then past to the maple section,
Then undo, the search and replace and re-do for the next board etc etc etc
Still quite time consuming
and unfortunately I need to fix the leaking roof above my home office
I've noticed the -O3 with LTO seems to cause some warnings to be displayed during compilation,
D:\Documents\Arduino\hardware\Arduino_STM32\STM32F1\system/libmaple/include/libmaple/timer.h:150:18: warning: type of 'timer4' does not match original declaration [enabled by default]
extern timer_dev timer4;
D:\Documents\Arduino\hardware\Arduino_STM32\STM32F1\cores\maple\libmaple\timer.c:68:11: note: previously declared here
timer_dev timer4 = GENERAL_TIMER(4);
same for all timers and also for the ADC
I can't see why these warnings are being generated.