Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Chrome 134
Windows
Desktop
4 days ago
Test name Executions per second
array reverse 142797.8 Ops/sec
typedArray reverse 348571.4 Ops/sec
array i/o 42226.1 Ops/sec
typedArray i/o 36137.1 Ops/sec
Script Preparation code:
AخA
 
var a = [...Array(10000)].map(_ => Math.random());
var ta = (new Float64Array(10000)).map(_ => Math.random());
Tests:
  • array reverse

     
    a.reverse();
  • typedArray reverse

     
    ta.reverse();
  • array i/o

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

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