public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/58770] New: GCC very slow compiling with #pragma once
@ 2013-10-17 17:11 yellow at rg3 dot name
  2014-06-27 15:47 ` [Bug preprocessor/58770] " olafurw at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: yellow at rg3 dot name @ 2013-10-17 17:11 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58770

            Bug ID: 58770
           Summary: GCC very slow compiling with #pragma once
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: yellow at rg3 dot name

Created attachment 31026
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31026&action=edit
Benchmark files

Putting #pragma once in a header file, with or without additional classic
include guards, makes GCC very slow.

I've created a small benchmark that I'm attaching, with the following files:

* common.h: a common file to be included 10,000 times, protected with guards or
the pragma. In the tarball there are three versions to be tested.

* header0000.h to header9999.h: header files that include common.h

* all.h: header file that includes all header????.h files.

* main.c: main program, includes common.h and all.h

Building that program with gcc -o main main.c takes 1.5 seconds with #pragma
once, while merely using include guards takes only 70 milliseconds.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-06-18 20:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-17 17:11 [Bug preprocessor/58770] New: GCC very slow compiling with #pragma once yellow at rg3 dot name
2014-06-27 15:47 ` [Bug preprocessor/58770] " olafurw at gmail dot com
2014-06-27 16:18 ` manu at gcc dot gnu.org
2014-07-03 20:30 ` tromey at gcc dot gnu.org
2014-07-07  9:52 ` manu at gcc dot gnu.org
2014-07-07 10:44 ` redi at gcc dot gnu.org
2023-06-18 20:58 ` sjames at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).