Array vs Uint16Array

Edit on GitHub

Setup

Tests

  • Array

    var a = new Array(1000);
    for(let i=0;i<1000;i++){
       a[i] = i;
    }
  • Uint16Array

    var b = new Uint16Array(1000);
    for(let i=0;i<1000;i++){
       b[i] = i;
    }