Note that there are some explanatory texts on larger screens.

plurals
  1. POVarying performance of MSVC release exe
    primarykey
    data
    text
    <p>I am curious what could be the reason for highly varying performance of the same executable. Sometimes, I run it and it takes 20 seconds and sometimes it is 110. Source is compiled with MSVC in Release mode with standard options.</p> <p>The code is here:</p> <pre><code>vector&lt;double&gt; Un; vector&lt;double&gt; Ucur; double *pUn, *pUcur; ... // time marching for (old_time=time-logfreq, time+=dt; time &lt;= end_time; time+=dt) { for (i=1, j=Un.size()-1, pUn=&amp;Un[1], pUcur=&amp;Ucur[1]; i &lt; j; ++i, ++pUn, ++pUcur) { *pUcur = (*pUn)*(1.0-0.5*alpha*( *(pUn+1) - *(pUn-1) )); } Ucur[0] = (Un[0])*(1.0-0.5*alpha*( Un[1] - Un[j] )); Ucur[j] = (Un[j])*(1.0-0.5*alpha*( Un[0] - Un[j-1] )); Un = Ucur; } </code></pre> <p><strong>EDIT</strong></p> <p>Sorry not to mention input data. The vectors Un and Ucur are initialized to 2000 elements with value 0. No data is read/written. No interaction with console. When I say sometimes I run it means that I have console open, no other applications running , processor throttling disabled. I keep executing application after it finishes. I guess it has to do with caching or something like that but I am not good on low-level things.</p> <p><strong>UPDATE</strong></p> <p>Issue was resolved when I switched the arguments in this function from addresses to variables. Before I had <code>double &amp;time, double &amp;dt, double &amp;end_time</code><br> Now: <code>double time, double dt, double end_time</code></p> <p>It appears to be memory-related issue... Hope, it helps anybody</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload