RFR (tedious) 8216022: Use #pragma once
Kim Barrett
kim.barrett at oracle.com
Thu Jan 3 16:09:24 UTC 2019
> On Jan 3, 2019, at 9:55 AM, coleen.phillimore at oracle.com wrote:
> On 1/3/19 2: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.
>
> I did a performance test of the build with and without this change and it took the same time to build hotspot on my machine (fastdebug) with and without. Both without precompiled headers.
>
> without:
> STARTED:Thu Jan 3 08:52:45 EST 2019
> DONE:Thu Jan 3 08:57:20 EST 2019
> with pragma once:
> STARTED:Thu Jan 3 08:58:44 EST 2019
> DONE:Thu Jan 3 09:03:19 EST 2019
>
>
> It may be that more than 1700 include files might cause a slower build. We've done a good job fixing our includes to not include everything.
I think the precompiled headers case needs to be checked. The recent heavy trimming
of precompiled.hpp probably helps a lot, but it would be unfortunate to lose all and then
some of the speedup obtained from that trimming.
More information about the hotspot-dev
mailing list