-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Revisit default compiler flags. #4159
Comments
I've been eyeing |
@derekargueta curious what the rationale in prioritizing this flag is. No objections at my end, just wondering if there are other warnings that might be higher signal. |
Saw this article about a 7% performance improvement for Chrome by enabling ThinLTO - https://blog.chromium.org/2022/03/a-new-speed-milestone-for-chrome.html |
I was thinking about this recently and I think we should do LTO by default. I honestly don't recall why we haven't done it yet. |
cc @wbpcode |
cc @keith who I've been talking about this offline. I think he is looking into enabling thin LTO now. |
Oh excellent! Can we call it out when it lands in Envoy Mobile? I want to call it out to Stan and see what it does to their A/B experiments. cc @RyanTheOptimist for visibility. |
There's currently an issue with antlr that causes this to not work, we're hoping that's fixed in an upcoming release, but otherwise this command works on my linux machine (if I hack around that issue):
|
It turns out if you disable wasm you should avoid all the issues with LTO, and produce an envoy binary with LTO successfully. As far as envoy-mobile you can also use LTO for iOS / Android by passing Next steps:
|
With @keith 's help I'm compiling on RBE with WASM disabled with the following added to # https://github.com/envoyproxy/envoy/issues/4159#issuecomment-1062001080
build --features=-per_object_debug_info
build --features=thin_lto
build --ltobackendopt=-Wno-unused-command-line-argument |
I've been testing on my M1 machine as with the manual flags instead of the feature, what errors are you seeing? |
Sorry, my M1 does have the updated |
What's the issue with Wasm? "full" LTO ( |
I believe this library is only enabled with wasm?
Some more convo about this: https://envoyproxy.slack.com/archives/C78HA81DH/p1646697338997329?thread_ts=1646697267.395829&cid=C78HA81DH |
LTO build works fine for me on
As for
|
What is the difference between @keith 's
and @PiotrSikora 's
|
ThinLTO vs "full" LTO. The latter should be better, but requires more memory at link-time. |
I didn't even try full LTO in general, so maybe that could be the difference in the outputs? But the bazel thin_lto feature does what I assume is the most optimized version of LTO for distributed builds https://github.com/bazelbuild/bazel/blob/ccf41d94f4a4179641ff4296e0845c70a6bc4c5f/tools/cpp/unix_cc_toolchain_config.bzl#L1123-L1184 |
FWIW the reason I had suggested thin LTO is I assumed that we would have build failures trying to do full LTO given our size, but that was just speculation. |
Yea I think they're supposed to be close enough that I think we'd use thin, and I imagine the issue was something else |
FWIW I tried the full RTO in the RBE clusters and it failed with what looked like a Clang 12.0.1 version error. If this is the case maybe we could bump RBE Clang to 13 (I think I've seen this discussed somewhere). |
Stack guards, LTO/ThinLTO, debug symbols, etc.
cc @mattklein123 @htuch @alyssawilk @lizan
The text was updated successfully, but these errors were encountered: