new RegExp() vs Literal vs Inline literal3,405,657 ops/sec
3,379,732 ops/sec
3,371,223 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| new RegExp() | |
| Literal | |
| Inline literal |
| Test name | Executions per second |
|---|---|
| ✓ Inline literal | 3,473,715 Ops/sec |
| new RegExp() | 3,444,816 Ops/sec |
| Literal | 3,384,303 Ops/sec |