pycallgraph icon indicating copy to clipboard operation
pycallgraph copied to clipboard

Speed up trace by a lot

Open gak opened this issue 16 years ago • 0 comments

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)

gak avatar Aug 12 '09 12:08 gak