[Python-Dev] bdb.py trace C implementation?

Benjamin Peterson benjamin at python.org
Thu Apr 2 00:25:57 CEST 2009


2009/4/1 David Christian <david.christian at gmail.com>:
> Hi all,
> I've recently written a C version of the trace function used in
> figleaf (the coverage tool written by Titus).  After a few rewrites to
> add in caching, etc, it gives users a significant speedup.  One person
> stated that switching to the C version caused coverage to decrease
> from a 442% slowdown to only a 56% slowdown.
>
> You can see my C implementation at:
>  http://github.com/ctb/figleaf/blob/e077155956c288b68704b09889ebcd675ba02240/figleaf/_coverage.c
>
> (Specific comments about the implementation welcome off-list).
>
> I'd like to attempt something similar for bdb.py (only for the trace
> function).  A naive C trace function which duplicated the current
> python function should speed up bdb significantly.  I would initially
> write the smallest part of the C implementation that I could.
> Basically the tracing function would call back out to python at any
> point where a line requires action.
>
> I'd be willing to maintain the C implementation.  I would be willing
> to write those tests that are possible as well.
>
> Is this something that would be likely to be accepted?

Generally debugging doesn't require good performance, so this is
definitely low priority. However, if you can contribute it, I don't
have a problem with it.



-- 
Regards,
Benjamin


More information about the Python-Dev mailing list