Skip to content
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

intelhex: Increase optimisation level to O3. #1014

Merged
merged 1 commit into from
Mar 16, 2023

Conversation

microbit-carlos
Copy link
Contributor

@microbit-carlos microbit-carlos commented Mar 16, 2023

Optimisation only applied to the intelhex.c file.

In my tests with micro:bit V2, when build with GCC v10.3, this can improve flashing time (rsync a .hex file with 512Kbs of flash data) by around 0.7-0.8 seconds.

For additional info, building the entire project with -O3 shaved another second-ish of flashing time, but that might be too much of a change/risk (it's likely it can also increase binary size, but I didn't really checked those numbers). I couldn't easily find another single file in the USB or vfs layer that significantly improved times on their own, just a tiny bit here and there, but the intelhex.c file is significant enough where this might be worth doing.

The specific compiler incantations have been copy/pasted from the SW_DP.c file:

#if defined(__CC_ARM)
#pragma push
#pragma O3
#pragma Otime
#elif defined(__GNUC__) && !defined(__ARMCC_VERSION)
#pragma GCC push_options
#pragma GCC optimize("O3")
#endif

@microbit-carlos microbit-carlos changed the title intelhex: Increase optimisation level to O3 for this file only. intelhex: Increase optimisation level to O3. Mar 16, 2023
@mathias-arm mathias-arm merged commit 64cf6e8 into ARMmbed:main Mar 16, 2023
@microbit-carlos microbit-carlos deleted the ihex-opt branch March 16, 2023 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants