for loop length cache (v5)

Revision 5 of this benchmark created by Kyle Simpson on

Preparation HTML

  var arr = new Array(10000),
      len = arr.length;

Test runner

Ready to run.

Testing in
no cache
for (var i = 0; i < arr.length; i++) {
 var a = arr[i];
cache length
for (var i = 0; i < len; i++) {
 var a = arr[i];


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

  • Revision 1: published by miller on
  • Revision 5: published by Kyle Simpson on