array iteration vs typed array iteration (v3)

Revision 3 of this benchmark created on


Setup

var array = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
    
    var typedArray = new Float32Array(9);
    
    for (var i = 0; i < 9; ++i) {
      typedArray[i] = 1.1;
    }

Test runner

Ready to run.

Testing in
TestOps/sec
array
for (var i = 0; i < 9; i += 3) {
  array[5] += 1.1;
}
ready
typed array
for (var i = 0, l = typedArray.length; i < l; i += 3) {
  typedArray[5] += 1.1;
}
ready

Revisions

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