Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36
Chrome 91
Linux
Desktop
3 years ago
Test name Executions per second
new RegExp() 3149531.5 Ops/sec
RegExp() factory 3203427.0 Ops/sec
Literal 8104004.5 Ops/sec
Literal premade 5909581.0 Ops/sec
Script Preparation code:
Tests:
  • new RegExp()

  • RegExp() factory

  • Literal

  • Literal premade