Optimisation Hints (dict processing and strings)

Peter Hansen peter at engcorp.com
Tue Mar 29 14:46:49 EST 2005


Thanks for the correction.  I didn't pause to think as I
wrote that...

-Peter
 

> -----Original Message-----
> From: Aaron Bingham [mailto:bingham at cenix-bioscience.com] 
> Sent: Tuesday, March 29, 2005 11:24
> To: Peter Hansen
> Cc: python-list at python.org
> Subject: Re: Optimisation Hints (dict processing and strings)
> 
> Peter Hansen <peter at engcorp.com> writes:
> 
> > You've misunderstood the comments about this area.
> > String concatenation is *not* "time consuming".
> > *Repeated* concatenations *will become very time 
> consuming*, along an 
> > exponential curve.  That's what the discussions about O(n^2) are 
> > referring to.
> 
> For the record, O(n^2) is /not/ exponential, but polynomial.  
> A function with exponential complexity would have, e.g. 
> O(A^n) for some constant A, which would be /much/ worse than 
> the behavior of repeated string concatenation.
> 
> Regards,
> 
> --
> --------------------------------------------------------------------
> Aaron Bingham
> Software Engineer
> Cenix BioScience GmbH
> --------------------------------------------------------------------
> 
> 




More information about the Python-list mailing list