Joel Uckelman on Mon, 3 Jan 2005 15:50:14 -0600 (CST)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [nimh-dev] more format profiling


Thus spake "Jon Stewart":
> 
> Nice profiling, Joel.

Thanks. The profile and pstats modules are very handy.
 
> It looks like a fair amount of time is spent in Parser.py:_parsebody. If 
> the name is any indication, that's largely unnecessary processing, since 
> we only care about headers the vast majority of the time.

What we need is a way to get the first n characters of the message body
without parsing the whole damn thing. The default scan line will print at
most 47 characters of message body (assuming a subjectless message and an
80-column terminal); any processing beyond that is wasted.

On looking through email/Parser.py, I found a class called HeaderParser
which purports to be the thing to use if you want the headers parsed but
the payload left as a string. That's precisely what we want; I'm going to
see about using that instead of the normal parser.

> I don't think we should let performance concerns discourage us. Three 
> quarters of a second is too long? Wait 2 years and you won't notice it, 
> thanks to incremental optimization and Moore's law.

Hey, wasn't I just telling you that about your distributed build setup? :)

_______________________________________________
nimh-dev mailing list
nimh-dev@xxxxxxxxxxx
http://lists.ellipsis.cx/mailman/listinfo/nimh-dev