How to profile with pypy (cProfile not working)

1.9k Views Asked by At

Is there any way in pypy to get a output like when you run python -m cProfile myscript.py?

pypy -m cProfile myscript.py is showing some random numbers (some of them negative), apparently this is a bug from 2011 not fixed yet.

1

There are 1 best solutions below

0
On BEST ANSWER

The issue has been fixed in release 2.5.0. cProfile is only going to get you so far, make sure your hot spots are run enough to warm up the JIT and then do benchmarking (timeit like statistics) rather than cProfile since the sampling method used in cProfile can itself slow things down.