native vs typed js array speed (v16)

Revision 16 of this benchmark created on


Preparation HTML

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

Setup

var sum = 0;

Test runner

Ready to run.

Testing in
TestOps/sec
Native Write
//Write
for (var i = arraySize-1; i; i--) {
 nativeArray[i] = i;
}
ready
Typed Write
//Write
for (var i = arraySize-1; i; i--) {
 typedArray[i] = i;
}

ready
Native Read
//Read
for (var i = arraySize-1; i; i--) {
 nativeArray[i];
}
ready
Typed Read
//Read
for (var i = arraySize-1; i; i--) {
 typedArray[i];
}
ready

Revisions

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