Optimisation Hints (dict processing and strings)

Aaron Bingham bingham at cenix-bioscience.com
Tue Mar 29 11:23:43 EST 2005


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