<html>#2512: Enable detection of `attribute(pure)`
<table style='border-spacing: 1ex 0pt; '>
<tr><td style='text-align:right'> Reporter:</td><td>Erik Schnetter</td></tr>
<tr><td style='text-align:right'>   Status:</td><td>new</td></tr>
<tr><td style='text-align:right'>Milestone:</td><td></td></tr>
<tr><td style='text-align:right'>  Version:</td><td>development version</td></tr>
<tr><td style='text-align:right'>     Type:</td><td>proposal</td></tr>
<tr><td style='text-align:right'> Priority:</td><td>minor</td></tr>
<tr><td style='text-align:right'>Component:</td><td>Cactus</td></tr>
</table>

<p>Comment (by Erik Schnetter):</p>
<p>Gabriele</p>
<p>There are two kinds of performance measurement tools: Profilers (which instrument, i.e. modify the code), and Tracers (which examine snapshots of the run every so many milliseconds).</p>
<p>Profilers have the advantage that they see all the code, where as tracers are blind to what happens in between the snapshots. The big disadvantage of profilers is that the code they insert might run too often, and this might slow down or distort the run. For example, if a profiler counts how often a particular routine is executed, and that routine ends up compiling to just a few machine instructions after inlining, then the overhead from profiling (at least to atomic read/write operations to memory) might be much larger than the cost of the routine, and this might present very distorted and unrealistic results.</p>
<p>These days, almost all tools are tracers. I’ve been using HPCToolkit recently. I’m sure VTune has a tracing mode as well. I think GCC has an option <code>-pg</code> to compile with profiling information – I would not use this method these days.</p>
<p>(I say “these days” because it used to be the case that all routines are expensive. With the advent of C++, functions can be small and can be completely optimized away, and this made profiling with traditional tools useless.)</p>
<p>‌</p>
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/2512/enable-detection-of-attribute-pure'>https://bitbucket.org/einsteintoolkit/tickets/issues/2512/enable-detection-of-attribute-pure</a></p>
</html>