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

Optimize for both speed and size #38

Open
eliasbakken opened this issue Feb 13, 2023 · 2 comments
Open

Optimize for both speed and size #38

eliasbakken opened this issue Feb 13, 2023 · 2 comments

Comments

@eliasbakken
Copy link

As suggested by Kevin O'Connor, it can be a good idea to optimize most of the code base for size, but some of it for speed.
For instance __attribute__((optimize("O2"))) on stepper related commands.

@goeland86
Copy link
Member

This is just an off-the-cuff thought, but on Gentoo, gcc optimizations for 02 are for speed, but 03 are speed and compressed instructions. I'm not all that familiar with the 0s Kevin referred to in the PR comment, but from what I recall, the 03 is meant to keep the speed optimizations while also compressing the code - it may not be as compressed as a pure size compression algorithm though.

@goeland86
Copy link
Member

Ok, this page on what the different gcc parameters do should help:
https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
I remembered it wrong, the -03 is just even faster optimizations, while -0s is the -02 without size increases.

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

2 participants