const vs var in closures (v9)

Revision 9 of this benchmark created by Ramana Venkata on


Preparation HTML

<script>
  var a = [];
  const b = [];
  var count = 5000;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
const
for (var i = 0; i < count; i++) {
  b.push(Math.random());
}
ready
var
for (var i = 0; i < count; i++) {
  a.push(Math.random());
}
ready
global const
 
ready
global var
 
ready

Revisions

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