Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36
Chrome 88
Mac OS X 10.15.7
Desktop
3 years ago
Test name Executions per second
new RegExp() 1846114.1 Ops/sec
RegExp() factory 1941429.9 Ops/sec
Literal 5037865.5 Ops/sec
Literal premade 3651031.2 Ops/sec
Script Preparation code:
Tests:
  • new RegExp()

  • RegExp() factory

  • Literal

  • Literal premade