Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.190 Safari/537.36
Chrome 88
Windows
Desktop
3 years ago
Test name Executions per second
new RegExp() 1968618.6 Ops/sec
RegExp() factory 2063451.2 Ops/sec
Literal 5698654.0 Ops/sec
Literal premade 3844230.2 Ops/sec
Script Preparation code:
Tests:
  • new RegExp()

  • RegExp() factory

  • Literal

  • Literal premade