Script Preparation code:
Tests:
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    text.includes()
    regex.test()
    string.match()
    string.indexOf()
    string.indexOf() !== -1
    string.indexOf() != -1

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Chrome 131 on Windows
View result in a separate tab
string.indexOf() != -1
57.9M/s
string.indexOf()
57.2M/s
string.indexOf() !== -1
56.8M/s
text.includes()
55.2M/s
regex.test()
9.9M/s
string.match()
7.2M/s
View exact numbers
Test name Executions per second
string.indexOf() != -1 57,929,040 Ops/sec
string.indexOf() 57,198,644 Ops/sec
string.indexOf() !== -1 56,758,340 Ops/sec
text.includes() 55,165,836 Ops/sec
regex.test() 9,927,778 Ops/sec
string.match() 7,203,115 Ops/sec