Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Function or if function
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Safari/605.1.15
Browser:
Safari 15
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
If before function
61432980.0 Ops/sec
function call
50760796.0 Ops/sec
Tests:
If before function
const normalize = (v) => { return '0x' + v } let color = '0xffffffff' if(!color.startsWith('0x')) { color = normalize(color) }
function call
const normalize = (v) => { if(v.startsWith('0x')) { return v } else { return '0x' + v } } let color1 = '0xffffffff' color1 = normalize(color1)