Hi again folks,

This thread[1] about using Array.prototype.slice to copy arguments
made me wonder whether the speed improvements I found had more to do
with the fact my implementation of the new mechanism had its own copy-
the-args function (which is faster than using `slice` on most
browsers; see the thread for details) than with eliminating calls and
function creation.  And the answer is:  No, but with the important
caveat:  On Chrome when using the "callSuper" helper, a big part of
the gains were indeed down to the copy-the-args function instead of
`slice`.  If I modify my new mechanism to use `slice` instead (which
obviously is the wrong way 'round, but never mind), when using the
helper the new mechanism is only about 2X faster on Chrome than the
old mechanism.  Of course, Firefox got faster in that scenario (since
Firefox is the one browser in my set of tests where using `slice` is
faster than one's own copy function).

So summing up, the new mechanism remains faster across-the-board even
using the helper, but the gains on Chrome will not be as marked (when
using a helper) as they seem at present because of the difference in
how args are copied.  And of course, one of the great things about the
new mechanism is that you don't have to copy args at all if you are
willing to use the more verbose syntax.

T.J. Crowder
tj / crowder software / com

On Sep 4, 3:09 pm, "T.J. Crowder" <t...@crowdersoftware.com> wrote:
> @Allen & @Jim,
> Gets my vote.
> -- T.J. :-)
> On Sep 4, 3:05 pm, Jim Higson <j...@wikizzle.org> wrote:
> > On Friday 04 September 2009 14:09:32 T.J. Crowder wrote:
> > > [...] I do _not_ mean that I
> > > think "callSuper" is a great name; I don't and I expect suggestions
> > > like yours to result in a better name.  But something unlikely to
> > > clash makes it simpler for people to do a global search-and-replace to
> > > convert $super(...) to this.niftyNameHere(arguments, ...).  
> > How about this.$super()?
> > --
> > Jim
> > my wiki ajaxification thing:http://wikizzle.org
> > my blog:http://jimhigson.blogspot.com/
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to