Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Chrome 120
Linux
Desktop
2 years ago
string.indexOf()
23.6M/s
text.includes()
23.3M/s
regex.test()
12.0M/s
string.match()
10.3M/s
View exact numbers
Test name Executions per second
string.indexOf() 23,599,012 Ops/sec
text.includes() 23,289,030 Ops/sec
regex.test() 12,021,490 Ops/sec
string.match() 10,299,440 Ops/sec
Script Preparation code:
Tests: