-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
platform.txt: instruct GCC to perform more aggressive optimization #7770
platform.txt: instruct GCC to perform more aggressive optimization #7770
Conversation
* add `-free -fipa-pta` to GCC options (generates a bit smaller binary) * cosmetics
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
gcc describes
(as @earlephilhower pointed it) IHere's the numbers with arduino-cli and FSBrowser on my host:
With:
What are the benefits when compiling Tasmota @jjsuwa-sys3175 @Jason2866 ? |
generally improving compiled output, of course not limited to Tasmota.
it seems IROM/IRAM savings to me, don't it? |
32 bytes over an entire 320K app is not a worthwhile optimization IMHO, especially if the compiler might need lots more memory or run slower as mentioned by the man pages. Not everyone is building on a top-spec box. |
from GCC manpage:
just exaggerated expression :) on my 10-years-old laptop PC, there is almost no difference. so to speak, both are slow likewise. and of course, most arduino users don't write so "large" (as GCC is called) sketches.
i guess that smallness regarding the executable binaries is virtue, especially in embedded systems. |
I tried an example that I thought might show some better results, BearSSL_Validation. On the one hand, this has a lot of smaller functions both inside the .A and the WiFi core, so gives more chance for savings. On the other hand, it uses virtuals (both c++ and emulated C) which means that inter-procedure analysis can't be done since you don't know at build-time what code will be called. Results are as follows: master
With this patch
112-4 byte savings (IRAM 4 bytes bigger) Rebuilding BearSSL .a with same settings + this patch
176-4 byte savings (IRAM again is 4 bytes larger w/the patch). I'm running a 1st gen Xeon E5 system and I didn't notice any time difference in builds, FWIW. So, @jjsuwa-sys3175 , I'll approve this and add it to BearSSL's build. We'll update the versionj when Newlib 4.0 comes in #7708. |
nice saveings, despite without any code modification :)
RODATA; 3844 -> 3832 :) |
…lash * upstream/master: (72 commits) Typo error in ESP8266WiFiGeneric.h (esp8266#7797) lwip2: use pvPortXalloc/vPortFree and "-free -fipa-pta" (esp8266#7793) Use smarter cache key, cache Arduino IDE (esp8266#7791) Update to SdFat 2.0.2, speed SD access (esp8266#7779) BREAKING - Upgrade to upstream newlib 4.0.0 release (esp8266#7708) mock: +hexdump() from debug.cpp (esp8266#7789) more lwIP physical interfaces (esp8266#6680) Rationalize File timestamp callback (esp8266#7785) Update to LittleFS v2.3 (esp8266#7787) WiFiServerSecure: Cache SSL sessions (esp8266#7774) platform.txt: instruct GCC to perform more aggressive optimization (esp8266#7770) LEAmDNS fixes (esp8266#7786) Move uzlib to master branch (esp8266#7782) Update to latest uzlib upstream (esp8266#7776) EspSoftwareSerial bug fix release 6.10.1: preciseDelay() could delay() for extremely long time, if period duration was exceeded on entry. (esp8266#7771) Fixed OOM double count in umm_realloc. (esp8266#7768) Added missing check for failure on umm_push_heap calls in Esp.cpp (esp8266#7767) Fix: cannot build after esp8266#7060 on Win64 (esp8266#7754) Add the missing 'rename' method wrapper in SD library. (esp8266#7766) i2s: adds i2s_rxtxdrive_begin(enableRx, enableTx, driveRxClocks, driveTxClocks) (esp8266#7748) ...
Hi @jjsuwa-sys3175 @earlephilhower ! Sorry to bring it back, but is there any reason why these flags weren't added to the PlatformIO build script? |
@valeros I think it was just an oversight. Can you open an issue on it to track for 3.0.1? Closed PRs don't get much visibility. |
add
-free -fipa-pta
to GCC options (generates a bit smaller binary)cosmetics
see arendst/Tasmota#9749 and arendst/Tasmota@e7cff92.