Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile with -O2 by default #74

Closed
flukiluke opened this issue Oct 31, 2018 · 12 comments
Closed

Compile with -O2 by default #74

flukiluke opened this issue Oct 31, 2018 · 12 comments

Comments

@flukiluke
Copy link
Collaborator

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).

@callowaysutton
Copy link

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

@FellippeHeitor
Copy link
Collaborator

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

@callowaysutton
Copy link

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

@andrew-ayers
Copy link

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...

@callowaysutton
Copy link

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
Copy link

Kroc commented Nov 3, 2018

  • Optimize for speed
  • Optimize for size

@alexmyczko
Copy link

[ ] 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?

@callowaysutton
Copy link

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

@callowaysutton
Copy link

Unless you mean the strip program?

@alexmyczko
Copy link

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

@callowaysutton
Copy link

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)

@FellippeHeitor
Copy link
Collaborator

Moved to https://github.com/QB64Team/qb64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants