-
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
build: use clang to build release binary. #4138
Conversation
Loading 1000 static listeners in a binary built with gcc takes ~51s, but only ~1.5s (34x faster) in a binary built with clang. *Risk Level*: Low *Testing*: Manual *Docs Changes*: n/a *Release Notes*: n/a Signed-off-by: Piotr Sikora <piotrsikora@google.com>
I'm not opposed to this, just wondering if there's any due diligence that's feasible to ensure we're not regressing elsewhere. Is it commonly accepted that modern Clang now produces more performance code than gcc? I know there were gcc holdouts for a long time because of the reverse, but times changes. |
can you add a line into Release Notes? |
+1 to htuch. Can we do some more diligence here? I'm shocked it's this much
faster. Do we know why? Can we profile the microbenchmark using cachegrind
to see?
In general I would like to switch to clang and also clang 6, but IMO we
should understand a bit better the implications.
…On Mon, Aug 13, 2018, 6:06 PM Lizan Zhou ***@***.***> wrote:
can you add a line into Release Notes?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4138 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGA17Oh1csqXnLtSDe-P99X8metfdsLMks5uQiKRgaJpZM4V7n4m>
.
|
Also, if we are going to tweak release build settings I would love to
revisit the current state of flto (whole program optimization).
…On Mon, Aug 13, 2018, 6:26 PM Matt Klein ***@***.***> wrote:
+1 to htuch. Can we do some more diligence here? I'm shocked it's this
much faster. Do we know why? Can we profile the microbenchmark using
cachegrind to see?
In general I would like to switch to clang and also clang 6, but IMO we
should understand a bit better the implications.
On Mon, Aug 13, 2018, 6:06 PM Lizan Zhou ***@***.***> wrote:
> can you add a line into Release Notes?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#4138 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AGA17Oh1csqXnLtSDe-P99X8metfdsLMks5uQiKRgaJpZM4V7n4m>
> .
>
|
Quick sanity check: this is for a "-c opt" build? |
@htuch / @mattklein123 the source of GCC slowdown is the construction of the @jmarantz yes. |
Wouldn't |
Yeah pretty positive this is true. |
Anyway, IMO we should close this and have a larger conversation about:
|
re 1. What's the point of closing this PR if we want to discuss this? |
Because IMO we should open an issue and discuss pros/cons there and an action plan. But it doesn't matter that much if we want to do it in the context of this issue. I do think that there should be some other perf tests run before we make the switch (not sure what they are, potentially we can smoke test a build at Lyft and @brian-pane @derekargueta @rgs1 can take a look at a clang build also)? Also per @lizan definitely should have a release note on this. I agree that moving to 6.0 and considering flto can happen in a different issue/PR. |
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
I did a bit more investigation on this, it looks like it is a bug that gcc didn't optimize Wrote a benchmark and here is the result:
#4117 brings this to unnoticeable difference by removing the fixed the minimum |
@lizan nice find, thanks! Since you already have the benchmark to reproduce this, what happens if you change the definition of
Does it it fix the issue with older versions of GCC? |
Nevermind, I've missed the linked benchmark - using |
@PiotrSikora we discussed in the community meeting and we would like to close this issue for now. Can you a) prep a PR to upgrade us to clang 6 (not controversial) and b) open an issue where we can discuss changing the default build to clang and a few other things like stack guards and flto? Thank you! |
Loading 1000 static listeners in a binary built with gcc takes ~51s,
but only ~1.5s (34x faster) in a binary built with clang.
Risk Level: Low
Testing: Manual
Docs Changes: n/a
Release Notes: n/a
Signed-off-by: Piotr Sikora piotrsikora@google.com