Declaring variables inside loops (v16)

Revision 16 of this benchmark created on


Description

Tests whether declaring a variable inside a loop, rather than declaring outside and just assigning values, is more performant

Test runner

Ready to run.

Testing in
TestOps/sec
Declare inside loop
for (var i = 0; i < 10000; i++) {
  var x = 1;
}
ready
Declare outside loop
var x;
for (var i = 0; i < 10000; i++) {
  x = 1;
}
ready

Revisions

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