[Python-Dev] pprint(iterator)

Nick Coghlan ncoghlan at gmail.com
Mon Feb 2 21:50:43 CET 2009


Tres Seaver wrote:
> Nick Coghlan wrote:
>> (and don't worry too much about 3 - it will give me an opportunity to
>> road test the functools patch by using it to refactor pprint and check
>> the performance implications)
> 
> /me wonders about the performance-criticality of anything using
> 'pprint'.   Or were you just planning to use it as a means to benchmark
> the 'simplegeneric' stuff?  I would think something with a lot lower
> intrinsic overhead would be a better benchmark target.

Don't read too much into that comment - generics make the most sense in
cases (like pprint) where extensibility is a more important feature than
raw speed. I'm talking about more subjective impressions of performance
as well as things like "if I register a handler for Sequence, is there
any performance advantage in registering direct handlers for the builtin
subclasses?".

Really drastic performance degradations would be on the radar as well -
slowing pprint() down by 10% is unlikely to bother anyone, but slowing
it down by 100% would be a bad thing (not that I think such a
degradation is likely, I'm just trying to give an impression of the
magnitude of change I'll be trying to measure).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------


More information about the Python-Dev mailing list