From: Jacob Fugal Date: 2009-03-09T07:48:53+09:00 Subject: [ruby-core:22765] Re: [Bug #1255] += for large strings egrigiously slow On Sun, Mar 8, 2009 at 12:40 PM, James Lee wrote: > I hadn't considered other references to the string. �Still, you already have to maintain a reference count, so if the number of references before the call to += is 1, it should be okay to do a destructive update, right? There's also the issue of monkey patching on String. a += b is, as far as I'm aware, just a syntactic shortcut for a = a + b. If someone has monkey patched String#+ to do something special, but a += b (where a is a String) ignores the new String#+ -- and they can't explicitly override += -- that could be a problem. Sure, you can argue (and most likely convince me) that String#+ shouldn't be monkey patched in the first place, but breaking it altogether is a rather wet blanket to throw on experimenters that might be trying to implement a more efficient String#+, etc. Jacob Fugal