https://forums.garmin.com/developer/connect-iq/b/news-announcements/posts/optimal-monkey-c
Can you be a little more clear garmin? What should i put in here for code optimization?
0
2
-2
0 -2
1
https://forums.garmin.com/developer/connect-iq/b/news-announcements/posts/optimal-monkey-c
Can you be a little more clear garmin? What should i put in here for code optimization?
0
2
-2
0 -2
1
I think your options are:
-O 0
-O 1
-O 2
-O 3
It may work without the space between -O and the optimization level, but I haven't tried it. (EDIT, yup it works.)
I agree the post could be more clear. As with a lot of CIQ stuff, you sort of have to read between the lines.

There's also a 3rd level. If you pass in an incorrect value for the -O argument (or if you pass in -h as an argument), you can see the command line args in the build output:
-O,--optimization <arg>Optimization level [0=none, 1=basic, 2=fast
optimizations, 3=slow optimizations] [p=optimize
performance, z=optimize code space]
It also looks like you can add the suffixes "p" and "z", so there's other possibilities such as: -O1p, -O1z, and -O1pz (I have no idea what would actually happen if you specify both p and z, but it's accepted by the compiler)
EDIT:
that's an interesting promo, but it looks like they intentionally didn't include it in the announcement, because I tested: -O2, -O2p -O2z, -O3, -O3p -O3z, and all of them produce the same code/data/... absolutely no difference in what I can see in the View Memory window. The only difference maybe is that some of the builds are slower but I bet that's just a mistaken subjective time "measurement" of mine. IMHO these are features they are working on and maybe we'll see some of this implemented in the future, maybe not.
i do not see any difference in size project vs eclipse but anyway
Check out the OP here:
forums.garmin.com/.../4-1-4-compiler-2-beta-code-size-comparsion
I tried the beta SDK with compiler optimization today and I think it is very nice to have.
I'm still using Eclipse and I had to add the "-O 2" option to get an improvement in code size.
When no parameter is used it seems to default to no optimization.
I had to fix some compile issues which was not a big deal and I managed to free 4kB of memory through the optimzation.
4kB of memory is about 4.5% of the size of my app.
This is huge for me since at this point I have to spend hours manually optimizing my code just to gain a few 100 Bytes here and there.