> On Sep 17, 2023, at 12:36 PM, Hans-Peter Nilsson via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
>
>> From: Sam James <s...@gentoo.org>
>> Date: Sun, 17 Sep 2023 05:00:37 +0100
>
>> Hans-Peter Nilsson via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
>>
>>>> Date: Tue, 29 Aug 2023 15:42:27 -0400
>>>> From: Marek Polacek via Gcc-patches <gcc-patches@gcc.gnu.org>
>>>
>>>> Surely, there must be no ABI impact, the option cannot cause
>>>> severe performance issues,
>>>
>>>> Currently, -fhardened enables:
>>> ...
>>>> -ftrivial-auto-var-init=zero
>>>
>>>> Thoughts?
>>>
>>> Regarding -ftrivial-auto-var-init=zero, I was consulted when
>>> colleagues investigating a performance regression
>>> pint-pointed it as *causing severe performance issues*;
>>> cf. https://github.com/systemd/systemd.git commit 1a4e392760
>>> (TL;DR: adds "-ftrivial-auto-var-init=zero" to the systemd
>>> build).
>>>
>>> The situation was described as "we noticed that some test
>>> suites takes 35% percent longer time to finish. After
>>> further investigation it was noticed that running systemctl
>>> unmask x takes around 5s more time on [version including
>>> patch vs. before that patch]" (timing out some tests).
>>> Reverting that patch fixed the drop in performance.
>>
>> Did some bug ever get filed for this to see if we can do a bit
>> better here?
>
> Not that I know of; neither for systemd nor gcc.
Then, is it convenient to file a bug on this? That will be very helpful for us
to locate the issue and fix it.
Before I committing the -ftrivial-auto-var-init patch, I have done some
performance testing on CPU2017 for x86 and aarch64,
The runtime overhead was quite limited.
Which platform the 35% performance slowdown was on?
Thanks.
Qing
>
>> Some slowdown doesn't mean it's of the expected magnitude.
>
> Can you please rephrase that?
>
>>> Just a data point, but I believe also exactly your intended
>>> use. IMO including -ftrivial-auto-var-init is worth extra
>>> consideration.
>>>
>>> Alternatively, strike the while "cannot cause severe
>>> performance issues".
>>>
>>> brgds, H-P