Script Preparation code:
AخA
 
var string = "Hello world!";
var regex = /Hello/;
Tests:
  • RegEx.test

     
    regex.test(string);
  • String.includes

     
    string.includes("Hello");
  • String.match

     
    string.match("Hello");
  • ==

     
    "Hello" == string.slice(0, "Hello".length);
  • === known length

     
    string.slice(0, 5) === "Hello"
  • startsWith

     
    string.startsWith("Hello")
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    RegEx.test
    String.includes
    String.match
    ==
    === known length
    startsWith

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 16 days ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Chrome 134 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
RegEx.test 52750816.0 Ops/sec
String.includes 179769120.0 Ops/sec
String.match 10607238.0 Ops/sec
== 185725104.0 Ops/sec
=== known length 179321760.0 Ops/sec
startsWith 92484744.0 Ops/sec