Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
Chrome 123
Linux
Desktop
8 months ago
Test name Executions per second
Array.reverse() 39787.9 Ops/sec
TypedArray.reverse() 139634.2 Ops/sec
Array.toSorted() 61.8 Ops/sec
TypedArray.toSorted() 1178.0 Ops/sec
Array.sort() 418.1 Ops/sec
TypedArray.sort() 19200.0 Ops/sec
Array[i] (sequential) 704.3 Ops/sec
TypedArray[i] (sequential) 725.7 Ops/sec
Array[i] (random) 231.4 Ops/sec
TypedArray[i] (random) 235.7 Ops/sec
Script Preparation code:
Tests:
  • Array.reverse()

  • TypedArray.reverse()

  • Array.toSorted()

  • TypedArray.toSorted()

  • Array.sort()

  • TypedArray.sort()

  • Array[i] (sequential)

  • TypedArray[i] (sequential)

  • Array[i] (random)

  • TypedArray[i] (random)