Skip to content

perf: for v2#315

Merged
yusukebe merged 5 commits intov2from
pref/request-v2
Mar 12, 2026
Merged

perf: for v2#315
yusukebe merged 5 commits intov2from
pref/request-v2

Conversation

@yusukebe
Copy link
Member

No description provided.

mgcrea and others added 5 commits February 10, 2026 22:38
- Read request body directly from IncomingMessage via events, bypassing
  expensive Web API chain (AbortController, Headers, Request, ReadableStream)
- Cache read buffer for potential later Request construction
- Add fast-path for URL construction without new URL() allocation
- Fall back to new URL() only when path normalization needed (.. sequences)
- Validate host header with lightweight character code checks

Improves body parsing benchmark by ~77% and query benchmark by ~15%
Add fast-path when no set-cookie headers exist, skipping per-header
string comparison in the most common case
perf: optimize request body reading, URL construction, and header building
* fix: More strictly, determine when new URL() should be used

* fix: compare host case-insensitively

* test: Add test cases for URL normalization

* refactor: separate URL normalization process code into separate files

* refactor(url): improve error class compatibility

* refactor: improve exception throwing

* fix: add missing src/error.ts

* test: improve test for error throwing
@yusukebe yusukebe merged commit 647e3b1 into v2 Mar 12, 2026
0 of 5 checks passed
@yusukebe yusukebe deleted the pref/request-v2 branch March 12, 2026 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants