Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36
Chrome 94
Windows
Desktop
3 years ago
Test name Executions per second
array reverse 6542864.5 Ops/sec
typedArray reverse 7424817.5 Ops/sec
array i/o 66043.4 Ops/sec
typedArray i/o 68038.9 Ops/sec
Script Preparation code:
AخA
 
var a = [...Array(100)].map(_ => Math.random());
var ta = (new Float64Array(100)).map(_ => Math.random());
Tests:
  • array reverse

     
    a.reverse();
  • typedArray reverse

     
    ta.reverse();
  • array i/o

     
    for (let i = 0; i < 100; ++i)
      a[i] = a[i] + 1;
  • typedArray i/o

     
    for (let i = 0; i < 100; ++i)
      ta[i] = ta[i] + 1;