Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Develop a few macros using the high performance timing mechanism of your CPU (e.g., <a href="http://en.wikipedia.org/wiki/Time_Stamp_Counter" rel="nofollow noreferrer">x86</a>) -- the routines that don't rely on system calls, and bind a single thread running your core loop to a specific CPU (<a href="http://en.wikipedia.org/wiki/Processor_affinity" rel="nofollow noreferrer">set the affinity</a>). You would need to implement the following macro's.</p> <pre><code>PROF_INIT //allocate any variables -- probably a const char PROF_START("name") // start a timer PROF_STOP() // end a timer and calculate the difference -- // which you write out using a async fd </code></pre> <p>I had something like this that I placed in every function I was interested in, I made sure the macro's placed the timing calls into the context of the call tree -- this is possibly the most accurate way to profile.</p> <p><strong>Note:</strong></p> <p>This method is <em>driven</em> by your code -- and does not rely on an external tool to <em>snoop</em> your code in any way. Snooping, Sampling and interrupt driven profiling is inaccurate when it comes to small sections of code. Besides, you want to control where and when the timing data is collected -- like at specific constructs in your code, like loops, the beginning of a recursive call-chain or mass memory allocations.</p> <p>-- edit --</p> <p>You might be interested in the <a href="https://stackoverflow.com/questions/1833253/preserving-the-execution-pipeline/1833390#1833390">link from this answer to one of my questions</a>.</p>
 

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