Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36
Chrome 76
Mac OS X 10.13.3
Desktop
5 years ago
Test name Executions per second
new RegExp() 2662439.2 Ops/sec
RegExp() factory 2757331.0 Ops/sec
Literal 6991242.5 Ops/sec
Literal premade 4890082.5 Ops/sec
Script Preparation code:
Tests:
  • new RegExp()

  • RegExp() factory

  • Literal

  • Literal premade