> A quick profiling of the code indicated that the performance problems
> are due to the string manipulation:
>
> str = str + "abc"
>
> is inefficient in python, because strings are immutable and doing string
> concatenation in a loop creates too many objects. (This is true of Java
> also). The trick is to collect them in a list and do string.join(list).
> Will make the change later today.
Not if you use StringBuffer in Java. (Not that Im some Java advocate or
anything, sometimes it _is_ painfully slow...) Is there any similar
mechanism in Python, or maybe this is it?
--Tapan
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
|