Run details:
Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Chrome 126
Chrome OS 14541.0.0
Desktop
3 days ago
Test name Executions per second
RegEx.test 28370144.0 Ops/sec
String.match 3017051.5 Ops/sec
Script Preparation code:
AخA
 
var string = "Hello world!";
var regex = /Hello/;
Tests:
  • RegEx.test

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

     
    string.match("Hello");