Script Preparation code:
Tests:

Historical Performance Data aggregated from 74 community runs

Desktop Results:
Chrome 58 runs
new RegExp()
13.2M/s
Literal
13.1M/s
View exact numbers
  • new RegExp(): 13,217,012 ops/sec
  • Literal: 13,076,204 ops/sec
Firefox 16 runs
new RegExp()
16.8M/s
Literal
16.7M/s
View exact numbers
  • new RegExp(): 16,764,740 ops/sec
  • Literal: 16,696,546 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    new RegExp()
    Literal

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 6 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:147.0) Gecko/20100101 Firefox/147.0
Firefox 147 on Windows
View result in a separate tab
Literal
10.8M/s
new RegExp()
10.3M/s
View exact numbers
Test name Executions per second
Literal 10,762,221 Ops/sec
new RegExp() 10,342,833 Ops/sec