Speeding up: s += "string"

Cameron Laird claird at lairds.com
Tue Apr 15 08:05:15 EDT 2003


In article <UoPma.20694$T34.658757 at news2.tin.it>,
Alex Martelli  <aleax at aleax.it> wrote:
			.
			.
			.
>If I wanted to pursue this kind of things, I think I'd try putting
>a Boost Python wrapper on top of STL's "rope" implementation of
>strings (note: STL and the Standard C++ Library are DIFFERENT things).
>
>This would give mutable strings that allow, not just s1+=s2, but all 
>sort of modifications, with very different performance characteristics
>from what one normally thinks of.  Measuring performance of text
>processing with those vs normal Python strings might be interesting...
>
>
>Alex
>

I'm not optimistic.  I'll be more precise:  the problem
is real, and good solutions are sensitive to data char-
acteristics.  It's easy to improve performance of the
s1 += s2 operations that characterize e-mail filtering
while simultaneously degrading unacceptably the same
operation embedded in an XML filter.  I am close to
asserting the conjecture that every solution harms too
many existing legitimate users.
-- 

Cameron Laird <Cameron at Lairds.com>
Business:  http://www.Phaseit.net
Personal:  http://phaseit.net/claird/home.html




More information about the Python-list mailing list