Script Preparation code:
AخA
 
function getRandomInt(max) {
  return Math.floor(Math.random() * Math.floor(max));
}
var a = [...Array(10000)].map(_ => Math.random(1000000));
var ta = (new Float32Array(10000)).map(_ => Math.random(1000000));
Tests:
  • array max apply

     
    Math.max.apply(Math, a);
  • typedArray max apply

     
    Math.max.apply(Math, ta);
  • array max

     
    Math.max(...a);
  • typedArray max

     
    Math.max(...ta);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    array max apply
    typedArray max apply
    array max
    typedArray max

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 10 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Chrome 126 on Windows
View result in a separate tab
Test name Executions per second
array max apply 102101.2 Ops/sec
typedArray max apply 3769.0 Ops/sec
array max 15071.9 Ops/sec
typedArray max 2160.2 Ops/sec