[Indic-computing-devel] Re: Indic-computing-devel digest, Vol 1 #38 - 8 msgs
Status: Alpha
Brought to you by:
jkoshy
From: Tapan S. P. <ta...@ya...> - 2002-03-14 07:25:17
|
> 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 |