Script Preparation code:
Tests:

Historical Performance Data aggregated from 15 community runs

Desktop Results:
Chrome 15 runs
text.includes()
26.7M/s
string.indexOf()
26.4M/s
regex.test()
14.9M/s
string.match()
9.8M/s

Fastest: text.includes() (2.7x faster)

View exact numbers
  • text.includes(): 26,727,032 ops/sec
  • string.indexOf(): 26,363,750 ops/sec
  • regex.test(): 14,873,630 ops/sec
  • string.match(): 9,800,356 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

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

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 10 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:140.0) Gecko/20100101 Firefox/140.0
Firefox 140 on Windows
View result in a separate tab
text.includes()
698.9M/s
string.indexOf()
684.2M/s
regex.test()
14.0M/s
string.match()
5.3M/s
View exact numbers
Test name Executions per second
text.includes() 698,914,048 Ops/sec
string.indexOf() 684,237,376 Ops/sec
regex.test() 13,969,979 Ops/sec
string.match() 5,263,850 Ops/sec