Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:135.0) Gecko/20100101 Firefox/135.0
Firefox 135
Mac OS X 10.15
Desktop
2 months ago
Test name Executions per second
array reverse 98440.8 Ops/sec
typedArray reverse 102374.0 Ops/sec
array i/o 71630.6 Ops/sec
typedArray i/o 119709.9 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;