"Optimize: ...." what does it do?
-
- Posts: 1
- Joined: Sat Jan 07, 2023 9:04 pm
"Optimize: ...." what does it do?
Hello. What do Smallest, "Fast (-O1)", "Faster (-O2)", "Fastest (-O3)" do in "Tools > Optimize:" in Arduino IDE? Which one to choose for which situations?
Re: "Optimize: ...." what does it do?
use -Os smallest unless your chip has lots of sram and flash, -O{2,3} etc is intended to be optimized for speed, more often at the expense of flash and sram. Not all chips can benefit from it, e.g. stm32f4xx and higher series (e.g. f7, h7) are more likely to benefit from those optimizations as the chips has more hardware to benefit from those optimizations
-
- Posts: 1
- Joined: Wed Mar 01, 2023 8:18 am
Re: "Optimize: ...." what does it do?
frequent at the price of sram and flash memory. Nevertheless, the stm32f4xx and later series (such as the f7 and h7) are more likely to reap the rewards of these enhancements since they have more hardware capable of handling them.
Re: "Optimize: ...." what does it do?
To my knowledge -Os is the smallest unless your chip has a lot of sram and flash, -O{2,3} is used to maximize for speed, often at the expense of flash and sram.