Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:133.0) Gecko/20100101 Firefox/133.0
Firefox 133
Linux
Desktop
3 months ago
Test name Executions per second
RegEx.test 32591708.0 Ops/sec
String.includes 930983168.0 Ops/sec
String.match 11451874.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");