Math.random vs crypto.randomUUID vs crypto.getRandomValuesFastest: Math.random (28.3x faster)
22,267,698 ops/sec
1,352,904 ops/sec
785,697 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| Math.random | |
| crypto.randomUUID | |
| crypto.getRandomValues |
| 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 |