Skip to content

Iffy perf claims at: Converting to an array #37

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

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
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
Collaborator

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
Something went wrong with that request. Please try again.