Iffy perf claims at: Converting to an array #37

Closed
jdalton opened this Issue Mar 12, 2011 · 2 comments

Comments

Projects
None yet
2 participants
@jdalton

jdalton commented Mar 12, 2011

So I don't see the perf concern of [].slice.call(arguments), use it if u need to slice up the arguments object:

var args = slice.call(arguments),
var first = slice.shift(); // remove first

foo(first);
bar.apply(null, args);

So basically use it when you need it and not when you don't :D

@jdalton

This comment has been minimized.

Show comment
Hide comment
@jdalton

jdalton Mar 12, 2011

You should also mention that by simply using the arguments object, engines may disable optimizations which will result is perf hit for the specific function. See issue 19.

jdalton commented Mar 12, 2011

You should also mention that by simply using the arguments object, engines may disable optimizations which will result is perf hit for the specific function. See issue 19.

@timruffles

This comment has been minimized.

Show comment
Hide comment
@timruffles

timruffles Oct 9, 2013

Collaborator

Any PR arising from this? I'm helping to maintain now so stuff is being merged.

Thanks.

Collaborator

timruffles commented Oct 9, 2013

Any PR arising from this? I'm helping to maintain now so stuff is being merged.

Thanks.

@timruffles timruffles closed this Oct 9, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment