recursive function

Benchmark created by Dan Manastireanu on


Preparation HTML

<script>
  var n = 1000;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
function name
var factorial = function(x) {
 if (x < 2) return x;
 return x * factorial(x - 1);
};
factorial(n);
ready
callee (anonymous)
(function(x) {
 if (x < 2) return x;
 return x * arguments.callee(x - 1);
}(n));
ready
callee
var factorial = function(x) {
 if (x < 2) return x;
 return x * arguments.callee(x - 1);
};
factorial(n);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.

  • Revision 1: published by Dan Manastireanu on