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

QB64 should be able to compile programs with -O2 #40

Closed
mkilgore opened this issue May 6, 2022 · 0 comments · Fixed by #87
Closed

QB64 should be able to compile programs with -O2 #40

mkilgore opened this issue May 6, 2022 · 0 comments · Fixed by #87
Labels
bug Something isn't working

Comments

@mkilgore
Copy link
Contributor

mkilgore commented May 6, 2022

Currently QB64 does not compile programs with any optimizations enabled. -O2 is reasonably safe to use and things appear to work (though more testing could be done), but the biggest issue appears to be speed and memory usage: Compiling qb64.bas with -O2 results in a ~15 minute compile on my machine and at one point uses ~10GB of memory, which is completely out of the realm of reasonable.

It appears most things compile fairly snappy (as you would expect) and the big culprit is qbx.cpp which imports main.txt, which is 200 thousand lines long for qb64.bas. Being that this contains all the function definitions in addition to the actual main code, with a lot of work it seems likely that this can be split into several .cpp files that can then get compiled own their own and linked together, significantly reducing the amount of code each gcc process has to deal with.

@mkilgore mkilgore added the bug Something isn't working label May 6, 2022
@mkilgore mkilgore added this to Backlog in Backlog/In Progress May 6, 2022
mkilgore added a commit to mkilgore/QB64pe that referenced this issue May 28, 2022
The new dialogs includes 5 settings:

1. Flag to turn on Optimization (off by default)
2. Flag to strip symbols (On by default)
3. String for extra compiler flags
4. String for extra linker flags
5. Setting for max compiler processes (default of 3)

Fixes: QB64-Phoenix-Edition#65
Fixes: QB64-Phoenix-Edition#40
mkilgore added a commit to mkilgore/QB64pe that referenced this issue May 28, 2022
The new dialogs includes 5 settings:

1. Flag to turn on Optimization (off by default)
2. Flag to strip symbols (On by default)
3. String for extra compiler flags
4. String for extra linker flags
5. Setting for max compiler processes (default of 3)

Fixes: QB64-Phoenix-Edition#65
Fixes: QB64-Phoenix-Edition#40
mkilgore added a commit to mkilgore/QB64pe that referenced this issue May 28, 2022
The new dialogs includes 5 settings:

1. Flag to turn on Optimization (off by default)
2. Flag to strip symbols (On by default)
3. String for extra compiler flags
4. String for extra linker flags
5. Setting for max compiler processes (default of 3)

Fixes: QB64-Phoenix-Edition#65
Fixes: QB64-Phoenix-Edition#40
mkilgore added a commit to mkilgore/QB64pe that referenced this issue May 31, 2022
The new dialogs includes 5 settings:

1. Flag to turn on Optimization (off by default)
2. Flag to strip symbols (On by default)
3. String for extra compiler flags
4. String for extra linker flags
5. Setting for max compiler processes (default of 3)

Fixes: QB64-Phoenix-Edition#65
Fixes: QB64-Phoenix-Edition#40
Backlog/In Progress automation moved this from Backlog to Done May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

1 participant