direct vs call vs apply (v4)

Revision 4 of this benchmark created by mesch on


Preparation HTML

<script>
  function calc(a, b, c) {
   return Math.sqrt((a * b / c) + 10)
  }
  var args = [5, 7, 8];
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
direct
calc(5, 7, 8);
ready
call
calc.call(null, 5, 8, 7);
ready
apply
calc.apply(null, args);
ready

Revisions

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