summaryrefslogtreecommitdiff
path: root/ext/web/internal.d.ts
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@gmail.com>2021-09-30 18:39:55 +0200
committerGitHub <noreply@github.com>2021-09-30 18:39:55 +0200
commit68e5cdaff0620b497e265d6e50bae6e994e86144 (patch)
tree8ae18f6d75bdc7bf70dc3ceaa13af9536c67da10 /ext/web/internal.d.ts
parentee2e25fba76a3d25df9d0d5d8d4d0286be915043 (diff)
perf(web): ~400x faster http header trimming (#12277)
Use a regex substring match with a first/last char fastpath instead of 2 regex replaces. Roughly ~400x faster (423ms vs 0.7ms in profiled runs)
Diffstat (limited to 'ext/web/internal.d.ts')
-rw-r--r--ext/web/internal.d.ts1
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/web/internal.d.ts b/ext/web/internal.d.ts
index 94fc9c196..89fdbacf3 100644
--- a/ext/web/internal.d.ts
+++ b/ext/web/internal.d.ts
@@ -29,6 +29,7 @@ declare namespace globalThis {
HTTP_TAB_OR_SPACE_SUFFIX_RE: RegExp;
HTTP_WHITESPACE_PREFIX_RE: RegExp;
HTTP_WHITESPACE_SUFFIX_RE: RegExp;
+ httpTrim(s: string): string;
regexMatcher(chars: string[]): string;
byteUpperCase(s: string): string;
byteLowerCase(s: string): string;