Posts: 65
Threads: 22
Joined: Apr 2022
Reputation:
2
I'm not clear what these optimizations do. Could someone give me a basic explanation of what this is?
If I want to try this in 0.8.0, do I simply plug that into Options > C++ Compiler Settings > C++ Compiler Flags?
Are there any negatives to using this flag that I should be aware of?
Posts: 303
Threads: 10
Joined: Apr 2022
Reputation:
44
Settings like `-O2`, `-O3`, etc. are C++ compiler optimization settings. Generally speaking, they speed up (and usually decrease the size) of the compiled program by perform optimizations when compiling the C++ code. Theoretically it doesn't matter what it does because as a QB64 developer you're not writing the C++ code anyway.
Personally, if you're not familiar with what those flags do then I'm not sure I would recommend using it at this point, as it's still not extremely clear how stable QB64 programs are when compiled with that setting. That said a fair number of community members have been using them and I don't think I've seen any issues reported yet, so that is a good sign.
To use `-O2` you can simply check the 'Compile program with C++ optimization flag' option in that dialog. To use any other option besides `-O2` you'll have to put it into the compiler flags yourself.
Posts: 660
Threads: 142
Joined: Apr 2022
Reputation:
58
-O0 is normally none and least optimized, -O3 the most optimized and hopefully quickest. (not sure is QB64 supports -O0)