<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 12, 2013 at 4:06 PM, Antoine Pitrou <span dir="ltr"><<a href="mailto:solipsis@pitrou.net" target="_blank">solipsis@pitrou.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi !<br>
<div class="im"><br>
On Tue, 12 Feb 2013 23:03:04 +0200<br>
Maciej Fijalkowski <<a href="mailto:fijall@gmail.com">fijall@gmail.com</a>> wrote:<br>
><br>
> We recently encountered a performance issue in stdlib for pypy. It<br>
> turned out that someone commited a performance "fix" that uses += for<br>
> strings instead of "".join() that was there before.<br>
><br>
> Now this hurts pypy (we can mitigate it to some degree though) and<br>
> possible Jython and IronPython too.<br>
><br>
> How people feel about generally not having += on long strings in<br>
> stdlib (since the refcount = 1 thing is a hack)?<br>
<br>
</div>I agree that += should not be used as an optimization (on strings) in<br>
the stdlib code. The optimization is there so that uncareful code does<br>
not degenerate, but deliberately relying on it is a bit devilish.<br>
(optimisare diabolicum :-))<br></blockquote><div><br></div><div style>Ditto from me. If you're going so far as to want to optimize Python code then you probably are going to care enough to accelerate it in C, in which case you can leave the Python code idiomatic. </div>
</div></div></div>