Script Preparation code:
Tests:

Historical Performance Data aggregated from 10 community runs

Desktop Results:
Chrome 10 runs
Math.random
22.3M/s
crypto.getRandomValues
1.4M/s
crypto.randomUUID
786K/s

Fastest: Math.random (28.3x faster)

View exact numbers
  • Math.random: 22,267,698 ops/sec
  • crypto.getRandomValues: 1,352,904 ops/sec
  • crypto.randomUUID: 785,697 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    Math.random
    crypto.randomUUID
    crypto.getRandomValues

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36
Chrome 145 on Windows
View result in a separate tab
Math.random
11.2M/s
crypto.getRandomValues
2.0M/s
crypto.randomUUID
697K/s
View exact numbers
Test name Executions per second
Math.random 11,207,073 Ops/sec
crypto.getRandomValues 2,027,594 Ops/sec
crypto.randomUUID 696,955 Ops/sec