<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'which one loop is faster and why?' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'which one loop is faster and why?' posted on the 'Embedded C/C++' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Wed, 19 Jun 2013 03:05:37 -0700</pubDate>
    <lastBuildDate>Wed, 19 Jun 2013 03:05:37 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>which one loop is faster and why?</title>
      <link>http://www.programmersheaven.com/mb/embedCpp/421134/421134/which-one-loop-is-faster-and-why/</link>
      <description>&lt;br /&gt;
&lt;br /&gt;
which one is faster&lt;br /&gt;
&lt;br /&gt;
1. for(i=0;i&amp;lt;num;i++)&lt;br /&gt;
2. for(i=num;i&amp;gt;0;i--)&lt;br /&gt;
assume that no code optimization and microprocessor has flags&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/embedCpp/421134/421134/which-one-loop-is-faster-and-why/</guid>
      <pubDate>Fri, 21 Jan 2011 10:51:32 -0700</pubDate>
      <category>Embedded C/C++</category>
    </item>
    <item>
      <title>Re: which one loop is faster and why?</title>
      <link>http://www.programmersheaven.com/mb/embedCpp/421134/421172/re-which-one-loop-is-faster-and-why/#421172</link>
      <description>&lt;span style="color: Blue;"&gt;Technically speaking these for loops will NOT do the same work, because index has different values (i will never be EQUAL to num in loop #1, but in loop $2 it WILL). The performance in FOR() part should be the same.&lt;/span&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/embedCpp/421134/421172/re-which-one-loop-is-faster-and-why/#421172</guid>
      <pubDate>Sat, 22 Jan 2011 06:20:20 -0700</pubDate>
      <category>Embedded C/C++</category>
    </item>
    <item>
      <title>Re: which one loop is faster and why?</title>
      <link>http://www.programmersheaven.com/mb/embedCpp/421134/421190/re-which-one-loop-is-faster-and-why/#421190</link>
      <description>but answer is given that 2nd loop is fast..i don't why there is some condition given regarding flags..&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/embedCpp/421134/421190/re-which-one-loop-is-faster-and-why/#421190</guid>
      <pubDate>Sun, 23 Jan 2011 00:07:47 -0700</pubDate>
      <category>Embedded C/C++</category>
    </item>
    <item>
      <title>Re: which one loop is faster and why?</title>
      <link>http://www.programmersheaven.com/mb/embedCpp/421134/423772/re-which-one-loop-is-faster-and-why/#423772</link>
      <description>As per the dis-assembly in the 1st for loop, an additional instruction is required to set the flag if index has reached the 'num' value. Where as in the 2nd for loop, the index can be directly checked if it's greater than zero.</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/embedCpp/421134/423772/re-which-one-loop-is-faster-and-why/#423772</guid>
      <pubDate>Thu, 12 May 2011 14:25:28 -0700</pubDate>
      <category>Embedded C/C++</category>
    </item>
  </channel>
</rss>