On Wed, Apr 1, 2009 at 6:53 PM, Benjamin Peterson <benja...@python.org> wrote: > 2009/4/1 Guido van Rossum <gu...@python.org>: >> Tracing has other uses besides debugging though. > > The OP said he wished to implement a C trace function for bdb. > Wouldn't that make it only applicable to debugging? > > Benjamin > I was suggesting a speedup for debugging. However, I could certainly also contribute my figleaf work that I referenced earlier, with a few tweaks, as a tracing replacement for the tracing function in trace.py.
My concern with moving the coverage tracing code in particular to the standard library is that it tries to extract the maximum speed by being clever*, and certainly has not been out in the wild for long enough. I would write something much more conservative as a starting point for bdb.py. I expect that any C implementation that was thinking about performance at all would be much better than the status quo. * figleaf checks a regular expression to determine whether or not we wish to trace a particular file. If the file is not being traced, I switch to the profiler instead of the line tracer, which means that the trace function only gets called twice per function instead of once per line. This can give a large speedup when you are skipping the entire standard library, at some measurable cost per function call, and a cost in code complexity. --- David Christian Senior Software Engineer rPath, Inc _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com