Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36
Chrome 70
Windows
Desktop
6 years ago
Test name Executions per second
Int16Array 95686.6 Ops/sec
Plain JS array 90561.1 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];
    }