title: Optimizing for PyPy
body: <p>(This is a follow-up to <a href="https://stackoverflow.com/questions/17346226/statistical-profiler-for-pypy">Statistical profiler for PyPy</a>)</p>
  
  <p>I'm running some Python code under PyPy and would like to optimize it.</p>
  
  <p>In Python, I would use <code>statprof</code> or <code>lineprofiler</code> to know which exact lines are causing the slowdown and try to work around them. In PyPy though, both of the tools don't really report sensible results as PyPy might optimize away some lines. I would also prefer not to use <code>cProfile</code> as I find it very difficult to distil which part of the reported function is the bottleneck.</p>
  
  <p>Does anyone have some tips on how to proceed? Perhaps another profiler which works nicely under PyPy? In general, how does one go about optimizing Python code for PyPy?</p>