Stefan Behnel, 03.07.2012 19:56:
> Amaury Forgeot d'Arc, 03.07.2012 18:26:
>> Then this should work:
>>    pypy/bin/py.py --withmod-cpyext -c "import nbody"
>>
>> *very* slowly of course, but I was able to debug pygames this way!
> 
> The problem is not so much that it's generally slow but that the
> performance characteristics of the Python code are likely way different
> than those of the translated C code. That's certainly the case for Cython
> code, running cProfile over Python code, running it over the compiled
> module and running callgrind over it often yields totally different
> results. That's why I would prefer running this through callgrind instead
> of Python+profile.

Ok, I finally managed to get a profile and it turned out to be completely
useless. I tried profiling inside of PyPy, but that doesn't tell me
anything about cpyext. I then tried profiling the interpreted PyPy itself
from CPython, but that only gives me a profile of the interpreted code,
which is clearly different from what the compiled code does. It spends lots
of time doing calls, for example, and the top time consuming function is
"getattr", followed by "build_ctypes_array". At least "api.py:wrapper" is
also somewhat up on the list, but it's just drowning in the noise.

Back to that question then:

> Is there a way to get readable debugging symbols in a translated PyPy that
> would tell me what is being executed?

Stefan

_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
http://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to