Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Chrome 134
Mac OS X 10.15.7
Desktop
one year ago
just make a string
167.7M/s
use existing regex
14.5M/s
instantiate new regex
14.2M/s
View exact numbers
Test name Executions per second
just make a string 167,660,256 Ops/sec
use existing regex 14,546,226 Ops/sec
instantiate new regex 14,204,612 Ops/sec
Script Preparation code:
Tests: