Run details:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0
Firefox 106
Ubuntu
Desktop
2 years ago
Test name Executions per second
RegEx.test 23268678.0 Ops/sec
String.includes 36282820.0 Ops/sec
String.match 9197101.0 Ops/sec
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");