Skip to content

Instantly share code, notes, and snippets.

@aheckmann
Created January 18, 2011 23:19
Show Gist options
  • Save aheckmann/785364 to your computer and use it in GitHub Desktop.
Save aheckmann/785364 to your computer and use it in GitHub Desktop.
arguments.callee is slower than a named function
var index;
function test (method) {
index = 0;
var start = new Date;
var i = 1000000;
while (--i) method();
console.log(new Date - start);
}
test(function named () {
named.k = index++;
})
test(function(){
arguments.callee.k = index++;
})
-----------------------
// results
-----------------------
named: 16ms
arguments.callee: 30ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment