Conversation
- 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
* perf(request): cache method key * refactor Co-authored-by: Taku Amano <taku@taaas.jp> --------- Co-authored-by: Taku Amano <taku@taaas.jp>
* perf(url): mark host with port `:` safehost * perf: added fast path handling for port numbers in the range 1000-59999 (#322) * perf: added fast path handling for port numbers in the range 1000-59999 * test: fix test description --------- Co-authored-by: Taku Amano <taku@taaas.jp>
* chore(test): migrate Jest to Vitest
* feat(test/utils): add coverage for `readWithoutBlocking` close/error cases
Ensure closed streams resolve with `{ done: true, value: undefined }`
and errored streams properly reject.
* feat(test/utils): use `toEqual()` instead of `toStrictEqual()`
* chore(test): run Vitest via CLI and pass `--expose-gc` through `execArgV`
* fix the test for Vitest
---------
Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
* build: migrate from tsup to tsdown Replace tsup (^7.2.0) with tsdown (^0.20.3) and update build/watch scripts accordingly. * build: align package.json exports with tsdown output extensions Update exports to use .cjs/.mjs/.d.cts/.d.mts extensions matching tsdown's actual output, and nest type definitions per format to resolve publint errors. * build: configure tsdown output extensions to match package.json exports * ci: separate build job with Node.js v24 for tsdown compatibility * ci: simplify ci-build job by removing matrix --------- Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.