Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
startswith vs split and equal
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/124.0.0.0 Safari/537.36
Browser:
Chrome 124
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Startswith
99235608.0 Ops/sec
Split and equal
11836700.0 Ops/sec
Tests:
Startswith
const key = 'noneofit_fbalbegl' if (key.startsWith('latest_')) { delay = 10000 } else if (key.startsWith('games-live')) { delay = 3000 } else if (key.startsWith('news_')) { delay = 10000 } else if (key.startsWith('highlight_')) { delay = 10000 } else if (key.startsWith('schedules-day_')) { delay = 10000 } else if (key.startsWith('video_')) { delay = 10000 }
Split and equal
const key = 'games-live_fbalbegl' const [type] = key.split('_') if (type === 'latest') { delay = 10000 } else if (type === 'games-live') { delay = 3000 } else if (type === 'news') { delay = 10000 } else if (type === 'highlight') { delay = 10000 } else if (type === 'schedules-day') { delay = 10000 } else if (type === 'video') { delay = 10000 }