Galleondragon/qb64

Compile with -O2 by default

flukiluke opened this issue · 12 comments

This flag is already used for most of the precompiled content but not the compilation of qbx.cpp. It has the potential to give a decent speedup (which god knows QB64 programs need).

That would just speed up the main application wouldn't it? Maybe make the compiler a little bit faster?
I don't know about that making the actual executables produced any faster

qbx.cpp is in every program compiled with QB64, not just the IDE.

Well then what are the hold backs of doing this? And then why not do -Ofast or -O3 since those optimize even further?

Just gunna throw my 2 cents in: Whatever flags that get passed to the compiler, ultimately they should be configurable (ideally from the IDE). There should definitely be a default set, and it should probably be for whatever makes the fastest executable. But there may be certain cases where you don't care about speed, but about size - so those optimizations should be possible. I could also see in the IDE being able to select "optimize for speed" and "optimize for size" and "custom flags" - or maybe a way to have multiple custom flag options that can be referenced by description (and in that case, the speed/size options could be such options in the list, but non-modifiable). Such a system would get complex quick; you'd probably want a way to copy the options to a new entry, a way to delete a defined config, and maybe a way to sort/rearrange the entries...

Just gunna throw my 2 cents in: Whatever flags that get passed to the compiler, ultimately they should be configurable (ideally from the IDE). There should definitely be a default set, and it should probably be for whatever makes the fastest executable. But there may be certain cases where you don't care about speed, but about size - so those optimizations should be possible. I could also see in the IDE being able to select "optimize for speed" and "optimize for size" and "custom flags" - or maybe a way to have multiple custom flag options that can be referenced by description (and in that case, the speed/size options could be such options in the list, but non-modifiable). Such a system would get complex quick; you'd probably want a way to copy the options to a new entry, a way to delete a defined config, and maybe a way to sort/rearrange the entries...

Yes, can this be added in the IDE menu? It shouldn't be hard to implement at all since all it is doing is changing part of a string in a text file.
Maybe just have a model type menu for it in the 'Options' menu?

Kroc commented
  • Optimize for speed
  • Optimize for size

[ ] run these commands on generated executable: [x] strip [x] upx...
strip as in: Discard symbols from object files.? run upx (Discard symbols from object files.) over it?

I'm pretty sure -s (Stripping) option is already enabled, but I'm not completely positive.

Unless you mean the strip program?

stripping with the compiler or stripping with the program is the same, afaik

stripping with the compiler or stripping with the program is the same, afaik

Sorry I was thinking of thinking of a different program that stripped a binary of unused functions (which I didn't realize was also another command line option in GCC -dead_strip)