Compiler Optimisation (Local compile)

Friends tell me that I can save up to 20% flash memory using this using optimisation with the local toolchain. Are there anyone with experience in optimising the Particle Firmware? Anything specific to look out for like flags that have to be set and such?

The default option is -Os (optimize for size). While you might be able to get the binary a little smaller with more aggressive optimization, the default settings already have optimization enabled.

This FAQ explains the opposite, how to turn optimization off, but it also explains where it is set, so that may be helpful.

2 Likes