<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://www.baszerr.eu/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>BaSzErr - blog:2014:07:11</title>
        <description></description>
        <link>https://www.baszerr.eu/</link>
        <lastBuildDate>Wed, 06 May 2026 09:46:30 +0000</lastBuildDate>
        <generator>FeedCreator 1.8</generator>
        <image>
            <url>https://www.baszerr.eu/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
            <title>BaSzErr</title>
            <link>https://www.baszerr.eu/</link>
        </image>
        <item>
            <title>gcc_s_performance_bug</title>
            <link>https://www.baszerr.eu/doku.php?id=blog:2014:07:11:gcc_s_performance_bug</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;gcc_s_performance_bug&quot;&gt;2014-07-11 - gcc&amp;#039;s performance bug&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
recently at work we moved to a newer GCC version. while testing C++11, we&amp;#039;ve noticed 30% loss in speed, on one of performance-critical components. this happened only when -std=c++11 was enabled. removing this flag regained original performance. this was a blocker for us – we could not afford such a speed loss. one of the colleagues saved they day by digging out &lt;a href=&quot;http://stackoverflow.com/questions/20977741/stdvector-performance-regression-when-enabling-c11&quot; class=&quot;urlextern&quot; title=&quot;http://stackoverflow.com/questions/20977741/stdvector-performance-regression-when-enabling-c11&quot; rel=&quot;ugc nofollow&quot;&gt;simillar performance issue&lt;/a&gt; on &lt;a href=&quot;http://stackoverflow.com&quot; class=&quot;urlextern&quot; title=&quot;http://stackoverflow.com&quot; rel=&quot;ugc nofollow&quot;&gt;stack overflow&lt;/a&gt;. one more compilation flag makes it all go away.
&lt;/p&gt;

&lt;p&gt;
the problem is that, when the new standard is enabled, makes standard library more complicated. this means a bit more templates, in particular. and yet GCC&amp;#039;s heuristics are NOT updated, to be in line with the new code, thus producing way suboptimal code on even the most trivial cases. difference is so huge (100% slower in stackoverflow&amp;#039;s example and 30% in our real world scenario) that even move semantics (when in use) cannot compensate for this. this should be noticed and fixed. the fix is so trivial – just rise one heuristic&amp;#039;s threshold. and yet the latest gcc 4.9 still does not do that. you just need to know it…
&lt;/p&gt;

&lt;p&gt;
clang does not loose on performance by enabling new standard, btw. in fact, it speeds things up. i wonder when will GCC get up to speed with that as well? or will this share the faith of a long forgotten &lt;a href=&quot;https://www.baszerr.eu/doku.php?id=blog:2014:04:24:gcc_resource_leak&quot; class=&quot;wikilink1&quot; title=&quot;blog:2014:04:24:gcc_resource_leak&quot; data-wiki-id=&quot;blog:2014:04:24:gcc_resource_leak&quot;&gt;resource leak, i found recently&lt;/a&gt;?
&lt;/p&gt;

&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 15 Jun 2021 20:08:52 +0000</pubDate>
        </item>
    </channel>
</rss>
