Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Random string 2
(version: 1)
Comparing performance of:
generate vs crypto.randomUUID()
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
var registeredIds = new Set(); function generate(length) { let id = Math.random().toString(36).substring(2, length + 2); while(this.registeredIds.has(id)) { id = Math.random().toString(36).substring(2, length + 2); } registeredIds.add(id); return id; }
Tests:
generate
generate(10)
crypto.randomUUID()
crypto.randomUUID()
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
generate
crypto.randomUUID()
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Browser/OS:
Chrome 133 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
generate
1325104.4 Ops/sec
crypto.randomUUID()
901684.0 Ops/sec
Related benchmarks:
lodash vs map 3
keys vs values
Stor info in Array vs Object
Compare TextEncoder, Blob, new TextEncoder
UUID Generation compare
Random ID generate
Math random UUID vs crypto UUID
wdwdagserg
+ '' vs .toString() v2
Comments
Confirm delete:
Do you really want to delete benchmark?