Declaring variables inside loops (v14)

Revision 14 of this benchmark created by jajajajajajaja 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 in a loop with one statement
for (var i = 0; i < 1000; i++) {
  var x = 1
}
ready
Declare outside loop
var x;
for (i = 0; i < 1000; i++) {
  x = 1;
}
ready

Revisions

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