When to choose aggressive optimization level?

Hi there,
I was recently playing around with different settings for the optimization level when compiling 64-bit apps on a mac with the target os also being macOS. I run several tests but could not find any major differences in performance between apps compiled with the default setting and those with optimization level set to aggressive. So here’s my question: in which circumstances would aggressive optimization increase performance? Or should you choose aggressive optimization for reasons other than performance optimization?
Thanks for enlightening me.

For faster math-related code execution time. :wink:


That’s all i found on developer.xojo.com

Whether you’ll notice a difference or not depends on what your app does. These optimization levels particularly affect math-intensive work, as Sascha says, but can also speed things up if you’ve lots of loops.

If your app is churning through scientific or image data, for example, you want to have this set to aggressive. If your app is a todo list, you aren’t going to see much difference.

Thanks for this feedback. So I shouldn’t expect any performance improvements when using aggressive optimization as my apps are mostly database focused.

On a side note I would recommend setting the optimization to default while debugging your app. I have seen major differences in compile time on iOS projects.

Something else that I have noticed is the more aggressive the optimization, the less memory the program uses. So if it is something that is always running in the background, aggressive might be the way to go, at least for released versions.