<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Geschwindigkeitsvergleich]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe ein Problem mit folgendem Codestück. Warum ist folgendes Codestück langsamer (7500ms)</p>
<pre><code class="language-cpp">int f;
    int j;
    int time = GetMilliCount();
    for(int i=0; i&lt;1000; i++) {
        for(j=0; j&lt;1500+i; i++)
            f = j;
    }
    printf(&quot;%i\n&quot;, GetMilliCount()-time);
</code></pre>
<p>als das hier (6400ms):</p>
<pre><code class="language-cpp">int time = GetMilliCount();
    for(int i=0; i&lt;1000; i++) {
        int f;
        int j;
        for(j=0; j&lt;1500+i; i++)
            f = j;
    }
    printf(&quot;%i\n&quot;, GetMilliCount()-time);
</code></pre>
<p>Ich lagere sogar das j aus um die Erzeugung außerhalb der Schleife zu unterstützen. Hat jemand eine Idee?</p>
<p>Dane, donnerCobra</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/251166/geschwindigkeitsvergleich</link><generator>RSS for Node</generator><lastBuildDate>Tue, 15 Sep 2026 14:31:31 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/251166.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 30 Sep 2009 09:03:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Geschwindigkeitsvergleich on Wed, 30 Sep 2009 09:27:23 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe ein Problem mit folgendem Codestück. Warum ist folgendes Codestück langsamer (7500ms)</p>
<pre><code class="language-cpp">int f;
    int j;
    int time = GetMilliCount();
    for(int i=0; i&lt;1000; i++) {
        for(j=0; j&lt;1500+i; i++)
            f = j;
    }
    printf(&quot;%i\n&quot;, GetMilliCount()-time);
</code></pre>
<p>als das hier (6400ms):</p>
<pre><code class="language-cpp">int time = GetMilliCount();
    for(int i=0; i&lt;1000; i++) {
        int f;
        int j;
        for(j=0; j&lt;1500+i; i++)
            f = j;
    }
    printf(&quot;%i\n&quot;, GetMilliCount()-time);
</code></pre>
<p>Ich lagere sogar das j aus um die Erzeugung außerhalb der Schleife zu unterstützen. Hat jemand eine Idee?</p>
<p>Dane, donnerCobra</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1786354</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1786354</guid><dc:creator><![CDATA[DonnerCobra]]></dc:creator><pubDate>Wed, 30 Sep 2009 09:27:23 GMT</pubDate></item><item><title><![CDATA[Reply to Geschwindigkeitsvergleich on Wed, 30 Sep 2009 09:18:09 GMT]]></title><description><![CDATA[<p>Niemand interessiert sich ernsthaft für die Geschwindigkeit von Code, der ohne jede Optimierung compiliert wurde.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1786362</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1786362</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Wed, 30 Sep 2009 09:18:09 GMT</pubDate></item><item><title><![CDATA[Reply to Geschwindigkeitsvergleich on Wed, 30 Sep 2009 09:19:50 GMT]]></title><description><![CDATA[<p>Vermutlich weil das Käse ist. Meintest du nicht j++ im Update-Ausdruck der inneren Schleife? Und was macht die eckige Klammer da einsam und verlassen im ersten Codestück? Bitte realen Code posten!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1786364</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1786364</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Wed, 30 Sep 2009 09:19:50 GMT</pubDate></item><item><title><![CDATA[Reply to Geschwindigkeitsvergleich on Wed, 30 Sep 2009 09:30:46 GMT]]></title><description><![CDATA[<p>Die eckige Klammer kam von [ -cpp- ]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1786374</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1786374</guid><dc:creator><![CDATA[DonnerCobra]]></dc:creator><pubDate>Wed, 30 Sep 2009 09:30:46 GMT</pubDate></item><item><title><![CDATA[Reply to Geschwindigkeitsvergleich on Thu, 01 Oct 2009 05:47:12 GMT]]></title><description><![CDATA[<p>So ist die Zeitmessung an sich auch etwas schwierig, da du nicht weisst wann dein Programmablauf vom Scheduler unterbrochen wird.<br />
Es kann also durchaus sein, dass dein erster Code schneller ist aber eben öfter/länger unterbrochen wird als der zweite.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1786724</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1786724</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Thu, 01 Oct 2009 05:47:12 GMT</pubDate></item></channel></rss>