Python-level sampling profiler
Uses setitimer() to set a recurring signal, and prints a Python stacktrace at the next safepoint aka allowGLReadPreemption. This is not great since allowGLReadPreemption can happen a decent amount later than the signal. (I'll play around with trying to get the signal to be acted on sooner, but it might be better to wait for full signal-handling support.) Still, it seems to provide some decent high-level info. For example, half of the startup time of the django-template benchmark seems to be due to regular expressions.
Showing
tools/process_stackdump.py
0 → 100644
Please register or sign in to comment