Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Switch vs map
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 131
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
Test name
Executions per second
Switch
73815016.0 Ops/sec
Map
71908344.0 Ops/sec
Tests:
Switch
const input = 10; switch(input) { case 1: return true; case 2: return true; case 3: return true; case 4: return true; case 5: return true; case 6: return true; case 7: return true; case 8: return true; case 9: return true; case 10: return true; }
Map
const input = 10; const LUT = { 0: true, 1: true, 2: true, 3: true, 4: true, 5: true, 6: true, 7: true, 8: true, 9: true, 10: true } LUT[input];