Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Firefox 128
Linux
Desktop
one month ago
Test name Executions per second
RegEx.test 42346516.0 Ops/sec
String.includes 1983659392.0 Ops/sec
String.match 19042230.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");