RFR (tedious) 8216022: Use #pragma once
Andrew Haley
aph at redhat.com
Thu Jan 3 10:51:52 UTC 2019
On 1/3/19 7:48 AM, Kim Barrett wrote:
> I think we shouldn't make this change without considering the impact
> of the following bug:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58770
> GCC very slow compiling with #pragma once
>
> According to comment 3, using "#pragma once" introduces N^2 behavior
> on the number of included files, because the duplicate check uses a
> list rather than a hashtable.
>
> At the very least, a performance comparison should be made to find out
> what the impact of that bug is.
Thank you for a very detailed analysis. I agree with you that this
shouldn't be changed, at least for now. I've been following the
discussion in the GCC lists and others for years, and the overall
feeling I get is that #pragma once isn't quite what we need for header
file inclusion. Instead, GCC and other compilers have a very high
performance implementation of include guards.
Nevertheless, I am still a GCC maintainer and I'll fix the bug in
#pragma once if it's really going to be useful. But based on some of
the known issues with #pragma once, I don't believe that it will
be. #pragma once is a nice idea, but I think that's all it is.
--
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
More information about the hotspot-dev
mailing list