-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
meson: use optimization level 3 and LTO by default #12097
base: master
Are you sure you want to change the base?
Conversation
Won't this slow down debug builds? |
In which sense? Speed of compilation, speed of execution, or something else? I guess it could slow down compilation depending on how costly the level three optimizations are. I don’t know that LTO is a bad idea, generally. I could refactor this to conditionally set optimization level to three when it isn’t a debug build, similar to what I removed in the refactor. I’d also really appreciate any pointers you can give on reliably benchmarking Nix! |
This should be 100% disabled for debug builds, optimization can make chabnes to the code which make debugging really hard, inlining, the infamous "where did my code go? right it was optimized away/unrolled" |
Should debug builds be built without any optimization? Because that’s not what happens currently :/ |
I'm not part of the Nix dev team, but in my experience having all optimizations off greatly helps staring at code in gdb/lldb. Since the machine code is closer to what's actually written the source code |
Yes for debug builds we like less optimization both because it means faster builds, and because it means the debug symbols are easier to understand / closer to the code. |
@Ericson2314 so should debug builds happen without any optimization, or with optimization level two (which is what happens prior to this PR)? |
I think without any optimization, right @edolstra? We could have the full nix builds instead specify more optimization with |
We should use |
Motivation
Let Meson handle optimization arguments for us.
Additionally, enables building with LTO, which was lost in the transition to Meson.
Testing
I'm not sure what the state-of-the-art is for benchmarking Nix. Any pointers?
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.