Function vs. Inline (v9)

Revision 9 of this benchmark created on


Preparation HTML

<script>
  runs = 1000;
  var testerFunction = function(i) {
   return runs + i;
  }
  var testerFunction2 = function(i) {
   var a = runs + i;
   return a * 2;
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
function call double
for (var i = 0; i < runs; i++) {
 var a = testerFunction2(i);
}
ready
inline double
for (var i = 0; i < runs; i++) {
 var a = runs + i;
 a = a * 2;
}
ready

Revisions

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