pycallgraph
pycallgraph copied to clipboard
Speed up trace by a lot
If you replace all sys.settrace(tracer) calls with sys.setprofile(tracer) and ignore the first return event in the tracer. Running a script will be dramatically faster.
(setprofile only logs call and return events, where settrace will also call the tracer function for each line that is interpreted)
You might also want to react on c_call and c_return events (logging extension modules)