[Python-Dev] Mailbox module - timings and functionality changes

Antoine Pitrou solipsis at pitrou.net
Tue Jun 29 18:34:22 CEST 2010


On Tue, 29 Jun 2010 11:40:50 -0400
Steve Holden <steve at holdenweb.com> wrote:
> Sure. I attach the outputs of both files, as well as the program and the
> data. With profiling (python -m cProfile test3.py) the run took less
> than a third of a second under 2.5, and 168 seconds under 3.1. I'd say
> that was problematical :)
> 
> I will leave the profiler output to speak for itself, since I can find
> nothing much to say about it except that there's a hell of a lot of
> decoding going on inside mailbox.iterkeys().

Ok, a lot of time is spent in cp1252 decoding. Somewhat less time, but
still too much of it, is spent in TextIOWrapper.tell(). This seems to
imply that mailbox files are opened in text mode, which sounds wrong to
me. Perhaps Andrew can shed more light on this?





More information about the Python-Dev mailing list