Run details:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Mobile Safari/537.36
Chrome Mobile 134
Android
Mobile
3 days ago
Test name Executions per second
array reverse 853012.1 Ops/sec
typedArray reverse 2047312.0 Ops/sec
array i/o 13019.7 Ops/sec
typedArray i/o 17672.8 Ops/sec
Script Preparation code:
AخA
 
var a = [...Array(1000)].map(_ => Math.random());
var ta = (new Float32Array(1000)).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;