Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
switch vs if js numbers
switch vs if
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:
11 months ago
Test name
Executions per second
if
81158824.0 Ops/sec
switch
88107840.0 Ops/sec
Tests:
if
const title = 5 if (title === 1) return if (title === 2) return if (title === 3) return if (title === 4) return if (title === 5) return
switch
const title = 5 switch (title) { case 1: return case 2: return case 3: return case 4: return case 5: return }