Script Preparation code:
Tests:

Historical Performance Data aggregated from 288 community runs

Desktop Results:
Chrome 244 runs
text.includes()
30.5M/s
string.indexOf()
30.4M/s
regex.test()
15.4M/s
string.match()
12.4M/s

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

View exact numbers
  • text.includes(): 30,452,560 ops/sec
  • string.indexOf(): 30,382,360 ops/sec
  • regex.test(): 15,396,231 ops/sec
  • string.match(): 12,373,802 ops/sec
Firefox 25 runs
string.indexOf()
1094.0M/s
text.includes()
1071.0M/s
regex.test()
25.3M/s
string.match()
15.8M/s

Fastest: string.indexOf() (69.3x faster)

View exact numbers
  • string.indexOf(): 1,093,978,752 ops/sec
  • text.includes(): 1,071,030,592 ops/sec
  • regex.test(): 25,311,298 ops/sec
  • string.match(): 15,790,091 ops/sec
Safari 6 runs
string.indexOf()
415.3M/s
regex.test()
386.1M/s
string.match()
125.4M/s
text.includes()
25.7M/s

Fastest: string.indexOf() (16.2x faster)

View exact numbers
  • string.indexOf(): 415,250,304 ops/sec
  • regex.test(): 386,130,560 ops/sec
  • string.match(): 125,371,240 ops/sec
  • text.includes(): 25,697,058 ops/sec
Other 5 runs
text.includes()
20.2M/s
string.indexOf()
19.0M/s
regex.test()
8.2M/s
string.match()
6.4M/s

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

View exact numbers
  • text.includes(): 20,206,092 ops/sec
  • string.indexOf(): 19,015,372 ops/sec
  • regex.test(): 8,194,358 ops/sec
  • string.match(): 6,402,257 ops/sec
Mobile Results:
Chrome 8 runs
text.includes()
13.5M/s
string.indexOf()
13.1M/s
regex.test()
8.4M/s
string.match()
6.1M/s

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

View exact numbers
  • text.includes(): 13,457,314 ops/sec
  • string.indexOf(): 13,055,995 ops/sec
  • regex.test(): 8,369,469 ops/sec
  • string.match(): 6,051,253 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: one month ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36
Chrome 149 on Windows
View result in a separate tab
string.indexOf()
200.7M/s
text.includes()
186.5M/s
regex.test()
25.6M/s
string.match()
18.1M/s
View exact numbers
Test name Executions per second
string.indexOf() 200,737,072 Ops/sec
text.includes() 186,534,704 Ops/sec
regex.test() 25,641,002 Ops/sec
string.match() 18,122,838 Ops/sec