native vs typed js array speed (v9)

Revision 9 of this benchmark created on


Preparation HTML

<script>
  var arraySize = 10000, s, v;

  
  var typedArray = new Int32Array(arraySize);
  var nativeArray = new Array(arraySize);
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Native array
//Write
s = arraySize;
while (s--) {
 nativeArray[s] = 0;
}

//Read
s = arraySize;
while (s--) {
 v = nativeArray[s];
}
ready
Typed array
//Write
s = arraySize;
while (s--) {
 typedArray[s] = 0;
}

//Read
s = arraySize;
while (s--) {
 v = typedArray[s];
}
ready

Revisions

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