Commit 1340068
committed
perf(http-request): hoist regex literals out of hot paths
Extract three regex patterns to module-scope constants:
- CHECKSUM_BSD_RE + CHECKSUM_GNU_RE: were recompiled once per line inside
parseChecksums()'s loop (V8 caches them, but explicit hoist is clearer
intent and sidesteps future engine changes)
- RETRY_AFTER_INT_RE: was a literal inside parseRetryAfterHeader()
Low-impact change — V8's regex literal cache usually handles this — but
the hoisted constants make the intent explicit and give the patterns
searchable names for future grep/audit.1 parent c441c8d commit 1340068
1 file changed
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1790 | 1790 | | |
1791 | 1791 | | |
1792 | 1792 | | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
1793 | 1797 | | |
1794 | 1798 | | |
1795 | 1799 | | |
| |||
1800 | 1804 | | |
1801 | 1805 | | |
1802 | 1806 | | |
1803 | | - | |
1804 | | - | |
1805 | | - | |
| 1807 | + | |
1806 | 1808 | | |
1807 | 1809 | | |
1808 | 1810 | | |
1809 | 1811 | | |
1810 | 1812 | | |
1811 | 1813 | | |
1812 | | - | |
| 1814 | + | |
1813 | 1815 | | |
1814 | 1816 | | |
1815 | 1817 | | |
| |||
1851 | 1853 | | |
1852 | 1854 | | |
1853 | 1855 | | |
1854 | | - | |
| 1856 | + | |
1855 | 1857 | | |
1856 | 1858 | | |
1857 | 1859 | | |
| |||
0 commit comments