This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/60976] Compilation with G++ 4.9.0 is 2-3 times slower than with 4.8.2


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

--- Comment #4 from Chernyshev Viacheslav <astellar at ro dot ru> ---
After a series of tests I'm pretty sure that it is not a problem of g++, but
libstdc++. Let me explain why do I think so.

First, I was not able to reduce real life case to reasonably small subset that
does not depend on external libs at least. So I've decided to test explicit
template instantiation of std::map for multiple combination of integer types as
key and value. File that I've used is attached as test.cpp.

Overall pattern was the same. After that I realized that results depend on
actual libstdc++ includes and I compare apples with oranges. So, I've used
these commands to get preprocessed dump:
- g++-4.8 -std=gnu++11 -O0 -E -P std_map.cpp > preprocessed_48.cpp
- g++-4.9 -std=gnu++11 -O0 -E -P std_map.cpp > preprocessed_49.cpp

After that I've compiled both files with g++-4.8 first and g++-4.9 second to
compare results. And it turned out that they are nearly the same for both
compilers depending on what file I compile. ftime-reports are in attachments.

I understand that it is not a bug per se, but compilation time for my project
that uses STL containers a lot jumped from 15 minutes to 40 minutes mark, and
it would be nice to reduce it back somehow.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]