Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
UUID Implementations vs crypto
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
Browser:
Chrome 136
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
crypto
749262.1 Ops/sec
regex v1
398273.9 Ops/sec
regex v2
132392696.0 Ops/sec
Tests:
crypto
const uuid = crypto.randomUUID();
regex v1
let d = Date.now(); if ( typeof performance !== 'undefined' && typeof performance.now === 'function' ) { d += performance.now(); // use high-precision timer if available } const uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { const r = (d + Math.random() * 16) % 16 | 0; d = Math.floor(d / 16); return (c === 'x' ? r : (r & 0x3) | 0x8).toString(16); });
regex v2
const uuid = () => [...Array(4)].map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join('-');