Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Chrome 121
Linux
Desktop
2 years ago
string.indexOf()
13.8M/s
text.includes()
13.8M/s
regex.test()
8.7M/s
string.match()
7.2M/s
View exact numbers
Test name Executions per second
string.indexOf() 13,833,514 Ops/sec
text.includes() 13,770,596 Ops/sec
regex.test() 8,742,252 Ops/sec
string.match() 7,179,322 Ops/sec
Script Preparation code:
Tests: