Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
string match in list: switch case vs array.includes
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0
Browser:
Firefox 136
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
one year ago
switch case
1160.9M/s
array.includes
23.7M/s
View exact numbers
Test name
Executions per second
✓
switch case
1,160,920,448 Ops/sec
array.includes
23,651,752 Ops/sec
Tests:
switch case
((v) => { switch (v) { case 'asdpopqnf': case 'zbvxcvuud': case 'qwtewoiru': case 'pojfopdgd': case 'tuunreiro': return true; } return false; })('tuunreiro')
array.includes
((v) => { return [ 'asdpopqnf', 'zbvxcvuud', 'qwtewoiru', 'pojfopdgd', 'tuunreiro' ].includes(v); })('tuunreiro')