Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Find substring in a long string
Benchmark finding a string in a substring via several methods.
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/130.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 130
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
IndexOf
11.2M/s
Includes
10.9M/s
test (regex)
3.0M/s
View exact numbers
Test name
Executions per second
✓
IndexOf
11,195,393 Ops/sec
Includes
10,874,977 Ops/sec
test (regex)
2,952,427 Ops/sec
Script Preparation code:
var string = 'test:segment:foo-bar:EBAC7R$MTVEQV3$GWF2WF2-2025@20240902:lorem-ipsum:v1:85136c79cbf9fe36bb9d05d0639c70c265c18d37'
Tests:
IndexOf
string.indexOf(':foo-bar:')
Includes
string.includes(':foo-bar:')
test (regex)
pattern = /:foo-bar:/ pattern.test(string)