# Profiling CPython with "perf"

**URL:** <https://discuss.python.org/t/profiling-cpython-with-perf/940>\
**Category:** Python Help\
**Created:** [February 26, 2019, 7:27pm UTC](https://discuss.python.org/t/profiling-cpython-with-perf/940 "2019-02-26T19:27:40Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![pitrou](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/pitrou/32/28_2.png) [@pitrou](https://discuss.python.org/u/pitrou)\
**Post date:** [February 26, 2019, 8:11pm UTC](https://discuss.python.org/t/profiling-cpython-with-perf/940/2 "2019-02-26T20:11:25Z")

</div>

In my experience, the line-by-line annotation isn’t reliable in “perf”. It may depend on your processor. I have a AMD Ryzen CPU.

If you want to check whether the DISPATCH change is responsible for some slowdown, the easiest way is to undo it, i.e. manually hoist the `&tstate->interp->ceval.eval_breaker` in a local variable at the beginning of `_PyEval_EvalFrameDefault` (since this is a pointer value that won’t change).

---

_[View the full topic](https://discuss.python.org/t/profiling-cpython-with-perf/940)._
