On 9/1/07, Lars T Hansen <[EMAIL PROTECTED]> wrote: > > On 9/1/07, David Golightly <[EMAIL PROTECTED]> wrote: > > Given the significant performance boost from moving this sort of > iteration > > into machine code from interpreted code, > > I don't agree with that assertion at all (or, I don't agree that > ECMAScript implementations are necessarily "interpreted", most are > compiling to byte code now and some are compiling to native code). > And even so, the overhead of calling the user function and collecting > the results is likely to dominate the running time of these functions.
Ok, I was going comparing Firefox 2.0's native implementation of Array.prototype.forEach against their JavaScript version (eg from here: http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:forEach#Compatibility), which though exactly compatible, adds a factor of roughly 1.2 to the linear execution time of the native version (according to my informal benchmarks). I realize that some current ECMAScript 3+ and most upcoming ECMAScript 4 implementations will likely be much more performant even than that. > I for one would greatly appreciate > > an official endorsement of these methods in ECMAScript 4. They > certainly > > seem to fit within the spirit of the existing ECMAScript 3 native array > > methods (slice, splice, etc.) and have parallels in the String prototype > > (indexOf, lastIndexOf). Is there a reason not to include them in ECMA > 4? > > If so, what might that be? > > They are included in the language. Good news! Thank you! -David
_______________________________________________ Es4-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es4-discuss
