<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic adding _mm_delay actually make the code run faster? in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/adding-mm-delay-actually-make-the-code-run-faster/m-p/960122#M21628</link>
    <description>&lt;P&gt;I experience an strange situation when I am optimizing some mic code.&lt;/P&gt;

&lt;P&gt;The new optimized code runs faster, measured using __rdtsc().&amp;nbsp; But the new run time is actually slower than the old code!&amp;nbsp; The code, by the way, is not a loop, and my co-worker found sometimes loop runs faster then unrolled loop.&amp;nbsp; This lead me to speculate that icache may be starved due to too may vector operation, so I added _mm_delay_32(n) to let it recover.&lt;/P&gt;

&lt;P&gt;This is the result I got&lt;/P&gt;

&lt;P&gt;no delay added -- run time 6.65&lt;/P&gt;

&lt;P&gt;delay(4) -- run time 6.63&lt;/P&gt;

&lt;P&gt;delay(8) -- run time 6.60&lt;/P&gt;

&lt;P&gt;delay(12) -- run time 6.57&lt;/P&gt;

&lt;P&gt;So can someone verify where my speculation has any basis in fact?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jan 2014 20:12:08 GMT</pubDate>
    <dc:creator>James_C_9</dc:creator>
    <dc:date>2014-01-15T20:12:08Z</dc:date>
    <item>
      <title>adding _mm_delay actually make the code run faster?</title>
      <link>https://community.intel.com/t5/Software-Archive/adding-mm-delay-actually-make-the-code-run-faster/m-p/960122#M21628</link>
      <description>&lt;P&gt;I experience an strange situation when I am optimizing some mic code.&lt;/P&gt;

&lt;P&gt;The new optimized code runs faster, measured using __rdtsc().&amp;nbsp; But the new run time is actually slower than the old code!&amp;nbsp; The code, by the way, is not a loop, and my co-worker found sometimes loop runs faster then unrolled loop.&amp;nbsp; This lead me to speculate that icache may be starved due to too may vector operation, so I added _mm_delay_32(n) to let it recover.&lt;/P&gt;

&lt;P&gt;This is the result I got&lt;/P&gt;

&lt;P&gt;no delay added -- run time 6.65&lt;/P&gt;

&lt;P&gt;delay(4) -- run time 6.63&lt;/P&gt;

&lt;P&gt;delay(8) -- run time 6.60&lt;/P&gt;

&lt;P&gt;delay(12) -- run time 6.57&lt;/P&gt;

&lt;P&gt;So can someone verify where my speculation has any basis in fact?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2014 20:12:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/adding-mm-delay-actually-make-the-code-run-faster/m-p/960122#M21628</guid>
      <dc:creator>James_C_9</dc:creator>
      <dc:date>2014-01-15T20:12:08Z</dc:date>
    </item>
    <item>
      <title>Someone else may know more</title>
      <link>https://community.intel.com/t5/Software-Archive/adding-mm-delay-actually-make-the-code-run-faster/m-p/960123#M21629</link>
      <description>&lt;P&gt;Someone else may know more about what is going on and step in with the answer but my suggestion would be to try Intel(r) VTune(tm) Amplifier, if you have it. That should be able to give you some idea of where the time is going and whether you have cache issues.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2014 06:01:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/adding-mm-delay-actually-make-the-code-run-faster/m-p/960123#M21629</guid>
      <dc:creator>Frances_R_Intel</dc:creator>
      <dc:date>2014-01-16T06:01:20Z</dc:date>
    </item>
    <item>
      <title>The delay issued by one</title>
      <link>https://community.intel.com/t5/Software-Archive/adding-mm-delay-actually-make-the-code-run-faster/m-p/960124#M21630</link>
      <description>&lt;P&gt;The delay issued by one thread within a core permits a different thread within the same&amp;nbsp;core to take the delaying thread's time slice of the core.&lt;/P&gt;

&lt;P&gt;This is different that what you experience with Intel64 or IA32.&lt;/P&gt;

&lt;P&gt;RE: VTune and this issue&lt;/P&gt;

&lt;P&gt;This would depend on if VTune included or excluded the delay ticks from the instruction cycle counts.&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2014 13:55:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/adding-mm-delay-actually-make-the-code-run-faster/m-p/960124#M21630</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2014-01-16T13:55:40Z</dc:date>
    </item>
    <item>
      <title>The problem seems to be with</title>
      <link>https://community.intel.com/t5/Software-Archive/adding-mm-delay-actually-make-the-code-run-faster/m-p/960125#M21631</link>
      <description>&lt;P&gt;The problem seems to be with c switch statement. When I recoded without switch, the problem seems to go away.&amp;nbsp; I guess the instruction branch prefetch just doesn't like the jump table.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2014 21:18:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/adding-mm-delay-actually-make-the-code-run-faster/m-p/960125#M21631</guid>
      <dc:creator>James_C_9</dc:creator>
      <dc:date>2014-01-16T21:18:06Z</dc:date>
    </item>
  </channel>
</rss>

