Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.5 Mobile/15E148 Safari/604.1
Mobile Safari 13
iOS 13.3.1
Mobile
5 years ago
Test name Executions per second
array reverse 153594.6 Ops/sec
typedArray reverse 382565.8 Ops/sec
array i/o 983.4 Ops/sec
typedArray i/o 1011.0 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;