[Python-Dev] Mailbox module - timings and functionality changes (original) (raw)
R. David Murray rdmurray at bitdance.com
Tue Jun 29 19:20:35 CEST 2010
- Previous message: [Python-Dev] Mailbox module - timings and functionality changes
- Next message: [Python-Dev] Mailbox module - timings and functionality changes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Tue, 29 Jun 2010 18:34:22 +0200, Antoine Pitrou <solipsis at pitrou.net> wrote:
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?
Given the current state of the email package for python3, it makes sense that it would open them in text mode. email can't currently process bytes, only text.
-- R. David Murray www.bitdance.com
- Previous message: [Python-Dev] Mailbox module - timings and functionality changes
- Next message: [Python-Dev] Mailbox module - timings and functionality changes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]