Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
Chrome 117
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
RegEx.test 7633176.0 Ops/sec
String.includes 30990336.0 Ops/sec
String.match 7460466.5 Ops/sec
Script Preparation code:
AخA
 
var string = "Hello world!";
var regex = /(unsuitable|join|faint|stage|honey|selection|two|fantastic|grain|sudden|coo|hand|grateful|impinge|breath|hurt|rest|stick|safe|lewd|accessible|erratic|actually|half|tested|illumine|earn|milk|snotty|forgetful|humdrum|conquer|merge|saddle|corrupt|disillusioned|sneaky|wrathful|upset|afford|amazing|scan|watery|stormy|statement|rightful|stress|coat|scattered|classify|friend|volcano|laugh|fork|salve|contend|illuminate|bust|wild|defeated|friendly|symptomatic|historical|pleasant|greasy|brass|fling|rhetorical|sloppy|charge|flawless|outgoing|giddy|giraffe|somber|swot|aboard|fascinated|lunchroom|cherry|destruction|haircut|side|begin|cute|tin|reply|skirt|spotted|obsequious|direction|scold|scat|cemetery|foot|guess|endorse|goat|strew|tin|frog|confiscate|cave|actor|shiver|trains|uproot|spotless|system|spark|audit|home|upbeat|relation|friends|inculcate|nail|cheerful|boundless|identify|enchanting|reading|classy|caption|sash|wiggly|potato|prescribe|succinct|outrageous|beast|persuade|moldy|successful|regret|pets|daily|wonderful|fast|skillful|study|endure|hill|map|shrill|blue-eyed|endurable|cuddly|boat|K|kite|productive|white|birds|animal|transport|kid|marble|frail|giddy|truculent|opinion|decrease|cream|half|meaty|rat|mitten|unbecoming|halting|fork|scissors|smart|spin|zebra|glib|old|dedicate|voice|useful|gifted|treatment|dip|future|multiply|lead|common|bleed|like|wound|scald|grade|direful|pale|guide|evanescent|spotty|dusty|fallacious|inexpensive)/;
Tests:
  • RegEx.test

     
    regex.test(string);
  • String.includes

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

     
    string.match("Hello");