https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97094
--- Comment #2 from Alexander Morozov <a.morozov at drweb dot com> --- $ g++-9.3.0 -v -std=c++17 Using built-in specs. COLLECT_GCC=g++-9.3.0 COLLECT_LTO_WRAPPER=/srv/projects/gcc/gcc-9.3.0-build/libexec/gcc/x86_64-pc-linux-gnu/9.3.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ./configure --enable-languages=c,c++ --prefix=/srv/projects/gcc/gcc-9.3.0-build Thread model: posix gcc version 9.3.0 (GCC) $ g++-10.2.0 -v -std=c++17 Using built-in specs. COLLECT_GCC=g++-10.2.0 COLLECT_LTO_WRAPPER=/srv/projects/gcc/gcc-10.2.0-build/libexec/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ./configure --enable-languages=c,c++ --prefix=/srv/projects/gcc/gcc-10.2.0-build Thread model: posix Supported LTO compression algorithms: zlib gcc version 10.2.0 (GCC) Also tried 11.0.0 20200913. The result does not look better: $ time -p g++-9.3.0 -std=c++17 -c str_map.cc real 6,64 user 6,06 sys 0,22 $ time -p g++-11 -std=c++17 -c str_map.cc real 68,83 user 62,11 sys 2,76 $ g++-11 -v -std=c++17 Using built-in specs. COLLECT_GCC=g++-11 COLLECT_LTO_WRAPPER=/srv/projects/gcc/gcc-11-20200913-build/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ./configure --enable-languages=c,c++ --prefix=/srv/projects/gcc/gcc-11-20200913-build Thread model: posix Supported LTO compression algorithms: zlib gcc version 11.0.0 20200913 (experimental) (GCC)