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 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0
Browser:
Firefox 132
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
IndexOf
2211938048.0 Ops/sec
Includes
2114672384.0 Ops/sec
test (regex)
36263584.0 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)