------- Comment #4 from paolo dot carlini at oracle dot com 2009-04-17 10:12 ------- Frankly, I don't think this is an issue. What we really want, is that all inline functions get inlined anyway, debug mode or not, and this is correctly happening, as far as I can see. Out of line functions are expected to not be inlined, even at -O3, because of the extern templates, indeed. All in all, also considering other metrics, like compile-time performance, code-size, and the ABI-impact of anything having to do with strings, I don't believe this is going to change any time soon. To repeat, the maintainers are well aware that, due to extern inline, out of line functions are not inlined even at -O3, but that is believed to be a good compromise, in general, outside the case of some special micro-benchmarks. It's definitely a well known design choice, which existed for string since the very beginning of the project.
For this specific micro-benchmark, the performance difference in debug-mode is noticeable only in 4.3.x, it wasn't in 4.2.x, probably because we are now inlining large functions a bit more easily. Actually the suppression of extern inline in debug-mode is just an historical accident, necessary in order to make sure debug-mode works also for the very special case of strings (vs all the standard containers). Some maintainers argued at length *against* it, because indeed it's sort of an hack, you can find something in the archive about it. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38132