https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87107

            Bug ID: 87107
           Summary: Template instantiation is 50x slower than with clang++
           Product: gcc
           Version: 8.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ufospoke at gmail dot com
  Target Milestone: ---

Created attachment 44598
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44598&action=edit
File to reproduce the issue

The new IO extension from GIL (boost 1.68.0) takes a very long time to compile
with g++ 8.2.0 compared to clang++ 5 or 6. Note that this is also true with g++
6 and 7 but not with g++ 5. I also opened an issue at boost::gil:
https://github.com/boostorg/gil/issues/131

I was able to identify which code exactly takes so much time to compile and I
was able to make it independent from any external libraries, in particular from
boost (MPL and GIL). See the attached file
"gcc-is-long-minimum-and-standalone.cpp".

With this particular program, g++ 8.2.0 is 53x longer than clang 6.0 on my
x86_64 linux computer (8.175 s vs 0.152 s).

The command line is:
g++-8.2.0 -o out.o -c -O2 -DNDEBUG -std=c++14
Progs/gcc-is-long-minimum-and-standalone.cpp

clang++ -o out.o -c -O2 -DNDEBUG -std=c++14
Progs/gcc-is-long-minimum-and-standalone.cpp

Reply via email to