Re: String concatenation

2011-10-07 Thread Tom Schuster
I think you just documented this: http://www.yafla.com/dforbes/String_Concatenation_and_Immutable_Strings_Speeding_Spidermonkey/ On Fri, Oct 7, 2011 at 2:01 AM, Wes Garland wrote: > On 6 October 2011 14:09, Tom Schuster wrote: >> >> (1) is in  fact really good optimized in modern engines.  (In c

Re: String concatenation

2011-10-06 Thread Wes Garland
On 6 October 2011 14:09, Tom Schuster wrote: > (1) is in fact really good optimized in modern engines. (In case you > are interested search for "Ropes: an alternative to strings") > You don't even need ropes to make this fast for a lot of common cases. I think even a naive implementer would co

Re: String concatenation

2011-10-06 Thread Tom Schuster
(1) is in fact really good optimized in modern engines. (In case you are interested search for "Ropes: an alternative to strings") I think today it's not a very good idea to propose methods on probably existing performance problems. On Thu, Oct 6, 2011 at 7:34 PM, Brendan Eich wrote: > (1) i

Re: String concatenation

2011-10-06 Thread Brendan Eich
On Oct 5, 2011, at 9:10 AM, Axel Rauschmayer wrote: >> The two concatenation approaches I know of are: >> 1. via += >> 2. push() into an array, join() it after the last push() >> >> (1) can’t possibly be efficient, >> >> Huh? Engines have optimized the hell out of 1 by essentially doing 2 under

Re: String concatenation

2011-10-05 Thread John Tamplin
On Wed, Oct 5, 2011 at 12:10 PM, Axel Rauschmayer wrote: > The two concatenation approaches I know of are: >> 1. via += >> 2. push() into an array, join() it after the last push() >> >> (1) can’t possibly be efficient, > > > Huh? Engines have optimized the hell out of 1 by essentially doing 2 un

Re: String concatenation

2011-10-05 Thread Axel Rauschmayer
> The two concatenation approaches I know of are: > 1. via += > 2. push() into an array, join() it after the last push() > > (1) can’t possibly be efficient, > > Huh? Engines have optimized the hell out of 1 by essentially doing 2 under > the hood. Even rhino's about a land a patch to do just th

Re: String concatenation

2011-10-05 Thread Dmitry Soshnikov
On 05.10.2011 19:45, Axel Rauschmayer wrote: Is this worthy of ES.next support? Or does it belong into a library? The two concatenation approaches I know of are: 1. via += 2. push() into an array, join() it after the last push() (1) can’t possibly be efficient, but if (2) is OK on all(!) platfo

Re: String concatenation

2011-10-05 Thread Dean Landolt
On Wed, Oct 5, 2011 at 11:45 AM, Axel Rauschmayer wrote: > Is this worthy of ES.next support? Or does it belong into a library? > > The two concatenation approaches I know of are: > 1. via += > 2. push() into an array, join() it after the last push() > > (1) can’t possibly be efficient, Huh? En

String concatenation

2011-10-05 Thread Axel Rauschmayer
Is this worthy of ES.next support? Or does it belong into a library? The two concatenation approaches I know of are: 1. via += 2. push() into an array, join() it after the last push() (1) can’t possibly be efficient, but if (2) is OK on all(!) platforms, then a library would be OK. However, give