[Python-Dev] Python profiler and other tools (original) (raw)

Alexander Belopolsky alexander.belopolsky at gmail.com
Sun Jul 25 20:34:09 CEST 2010


On Sun, Jul 25, 2010 at 1:22 PM, "Martin v. Löwis" <martin at v.loewis.de> wrote: ..

It is at best entertaining to ponder about reasons here; I doubt anything productive can come out of such a discussion.

I disagree. Depending on the reasons for the relative lack of attention to these components, several alternative actions can be taken to improve the situation. Let's focus on the trace module because it is the simplest and in my opinion the most neglected of the three. Guido suggested that a tool like this is best developed outside of stdlib and python-dev should focus on providing stable interfaces such as sys.settrace to third party projects. On one hand, I would agree that it is better not to distribute the trace module at all than to distribute a broken implementation. (Quality of coverage tools is particularly important now when many developers try to improve up their test coverage before or during transition to 3.x.) On the other hand, using sys.settrace interface requires knowledge of the frame object structure which AFAICT is an implementation detail and may change from version to version. I think stdlib should expose a more abstract tracing API such as one implemented by the trace module which would hide frame object details from the user and give direct access to the data extracted from the frames such as file names and line numbers. A higher level module within stdlib can take advantage of implementation details and not be burdened by having to support multiple releases as long as its own user facing API is stable.

It may be fun posting a message to a ten-year-old issue saying "ACT NOW (you sluggards)", but I question that this will, on average, improve things. Likewise, speculating that tool support is deliberately ignored probably won't improve things (specifically not responding to Nick here).

I assume this is directed at Mark Lawrence even though I made the top post under this subject. While I expressed my own share of criticism of Mark's ways, I do believe that what he is doing is extremely valuable. I did not expect such an outcome, but Mark had a lot of success closing the issues that simply slipped under the radar, but were resolved or close to resolution in every other respect. He is apparently putting a lot of his volunteer hours into this work and this is reason enough to overlook occasional rants or poor choice of words. Mark's breadth-first approach to the tracker is unique and does not work for a lot of issues, but at the same time it does work maybe 10-20% of the time and as long as Mark himself does not get discouraged by the low success rate and learns how to communicate more effectively, I think his work will continue benefiting python.

On the other hand, posting actual patches that fix actual bugs can make a lot of a difference. Also, having a maintainer who is willing to look into these patches and accept the good ones will make a lot of a difference.

With respect to the trace module, I started both of these things already, but I would really like to hear feedback from people interested in the future of pdb and profile modules as well.



More information about the Python-Dev mailing list