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

Consider adding link-time optimisation (-lto) build option #92

Open
woollybah opened this issue Jul 17, 2019 · 3 comments
Open

Consider adding link-time optimisation (-lto) build option #92

woollybah opened this issue Jul 17, 2019 · 3 comments

Comments

@woollybah
Copy link
Member

woollybah commented Jul 17, 2019

Link-time optimisation (some info here and here ) can potentially create smaller, faster binaries.

The main caveat is longer build times - because the compiler makes more than 1 pass over the code, performing more analysis.

So this would be an option you'd enable later in your process, rather than during heavy development.

We may need some non-scientific benchmarks to see if this makes much of a different to BlitzMax apps.

@woollybah
Copy link
Member Author

As a random example of lto to create smaller files, I did a test on tarraylist_sort.bmx from the brl.collections doc folder.
The standard release build created a file of 463133 bytes.
With an lto release build, it created a file of 377962 bytes.

I would guess the % savings are likely to decrease as the binary gets larger.

@Kerntrick
Copy link

20% is not bad. It could be good as an option for making public release builds. For me, compile time trumps runtime most of the time.
On the subject of optimization, NG could really use a profiler.
Is there a way sample the state of 'OnDebugEnterStm' with another thread at runtime to do some basic profiling? It's a terrible idea, but desperate times.....

@braxtonrivers
Copy link

braxtonrivers commented Nov 19, 2021

I know that I am late to this, lto is a great idea, I have been testing this with /Os and am happy with the results.

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

No branches or pull requests

3 participants