Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
byte to hex
(version: 1)
Comparing performance of:
string concatenation vs padStart
Created:
one month ago
by:
Guest
Go to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
byte = crypto.getRandomValues(new Uint8Array(1))[0]
Tests:
string concatenation
(byte < 16 ? '0' : '') + byte.toString(16)
padStart
byte.toString(16).padStart(2, '0')
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
string concatenation
padStart
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one month ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:152.0) Gecko/20100101 Firefox/152.0
Browser/OS:
Firefox 152 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
string concatenation
1476.7M/s
padStart
125.6M/s
View exact numbers
Test name
Executions per second
✓
string concatenation
1,476,706,304 Ops/sec
padStart
125,569,128 Ops/sec
Related benchmarks
uuid generation crypto.getRandomValues
crypto.getRandomValues(new Uint8Array(4)) vs crypto.getRandomValues(new Uint16Array(2)) vs crypto.getRandomValues(new Uint32Array(1))
Simple benchmark
Comments
Confirm delete:
Do you really want to delete benchmark?