Tests:

Historical Performance Data aggregated from 72 community runs

Desktop Results:
Chrome 66 runs
Math.random
16.0M/s
crypto API
832K/s

Fastest: Math.random (19.3x faster)

View exact numbers
  • Math.random: 16,030,738 ops/sec
  • crypto API: 832,086 ops/sec
Firefox 6 runs
Math.random
1245.0M/s
crypto API
1.2M/s

Fastest: Math.random (1054.4x faster)

View exact numbers
  • Math.random: 1,244,993,152 ops/sec
  • crypto API: 1,180,720 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 API

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 7 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Chrome 142 on Mac OS X 10.15.7
View result in a separate tab
Math.random
65.6M/s
crypto API
455K/s
View exact numbers
Test name Executions per second
Math.random 65,569,552 Ops/sec
crypto API 454,750 Ops/sec