Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36
Chrome 88
Linux
Desktop
3 years ago
Test name Executions per second
Int16Array 172650.8 Ops/sec
Plain JS array 174330.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];
    }