Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0
Firefox 106
Linux
Desktop
2 years ago
Test name Executions per second
Int16Array 12689053.0 Ops/sec
Plain JS array 11226958.0 Ops/sec
Script Preparation code:
x
 
var int16 = new Int16Array(100);
var regular = [];
for(var i=0;i<100;i++){
  int16[i] = i;
  regular.push(i);
}
Tests:
  • Int16Array

     
    var sum = 0;
    for(var i=0;i<100;i++){
      sum = sum + int16[i];
    }
  • Plain JS array

     
    var sum = 0;
    for(var i=0;i<100;i++){
      sum = sum + regular[i];
    }