Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0
Chrome 127
Linux
Desktop
2 years ago
text.includes()
11.8M/s
string.indexOf()
11.3M/s
regex.test()
10.5M/s
string.match()
9.3M/s
View exact numbers
Test name Executions per second
text.includes() 11,799,406 Ops/sec
string.indexOf() 11,254,762 Ops/sec
regex.test() 10,511,585 Ops/sec
string.match() 9,284,405 Ops/sec
Script Preparation code:
Tests: