Repository navigation
Conversation
anonrig
marked this pull request as ready for review
August 18, 2026 01:50
cursor
Bot
force-pushed
the
cursor/urlpattern-performance-603e
branch
6 times, most recently
from
August 18, 2026 18:43
ed512d0 to
1ba9273
Compare
CallIntoModule() reset last_exception only after handle_exception() returned. When handle_exception() reports the exception through 'uncaughtException', the listener runs while the exception is still pending, so calling back into the module from it saw the same exception again: an addon function failed with napi_pending_exception and rethrew it, and a finalizer run by gc() in an experimental module reported it a second time, which aborted the process with "Re-entrant uncaught exception detected". Take the exception out of last_exception before handling it. Fixes: nodejs#67421 Assisted-by: a coding agent Signed-off-by: Manjeet Singh <024manjeetsingh@gmail.com> PR-URL: nodejs#67448 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Signed-off-by: LiviaMedeiros <livia@cirno.name> PR-URL: nodejs#67582 Refs: https://github.com/nodejs/node/blob/HEAD/doc/contributing/erm-guidelines.md#debuggability-of-disposer-methods Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Signed-off-by: LiviaMedeiros <livia@cirno.name> PR-URL: nodejs#67582 Refs: https://github.com/nodejs/node/blob/HEAD/doc/contributing/erm-guidelines.md#debuggability-of-disposer-methods Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Signed-off-by: ishabi <ilyasshabi94@gmail.com> PR-URL: nodejs#67732 Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> Reviewed-By: James M Snell <jasnell@gmail.com>
Co-authored-by: Brian Muenzenmeyer <brian.muenzenmeyer@gmail.com> Signed-off-by: avivkeller <me@aviv.sh> PR-URL: nodejs#66713 Reviewed-By: Claudio Wunder <cwunder@gnome.org> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Signed-off-by: Mohamed Sayed <k@3zrv.com> Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> PR-URL: nodejs#67112
Add `request.signal` to `Http2ServerRequest`, matching `message.signal` in HTTP/1. The signal follows the stream, not the socket: it is aborted when the stream closes before the response has been sent completely. Refs: nodejs#62541 Refs: nodejs#64392 Signed-off-by: inoway46 <inoueyuya416@gmail.com> Assisted-by: Claude Code PR-URL: nodejs#67774 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
`expandedSQL`, `sourceSQL`, column names and the `sqlite.db.query` trace callback passed SQL text to `String::NewFromUtf8()` without a length, and V8 aborted on text longer than `String::kMaxLength`. Pass the length instead. The getters and column names now throw `ERR_STRING_TOO_LONG`, and the trace callback skips the event so the statement still runs. Co-authored-by: lazerg <lazerg2@gmail.com> Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com> PR-URL: nodejs#67768 Fixes: nodejs#66487 Refs: nodejs#66498 Reviewed-By: Guilherme Araújo <arauujogui@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net> PR-URL: nodejs#67778 Fixes: nodejs#67267 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: LiviaMedeiros <livia@cirno.name> Reviewed-By: Efe Karasakal <hi@efe.dev> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
When a server responds before it has read the whole request body, the client stops forwarding the socket's 'drain' to the request as soon as the response is complete. A writer that honors backpressure, such as a stream piped into the request, then never receives 'drain', never calls end(), and the socket keeps the process alive. Keep the 'drain' listener until the request has ended and remove it in responseKeepAlive() when the socket is released back to the pool. Fixes: nodejs#67763 Signed-off-by: Matteo Collina <matteo.collina@gmail.com> PR-URL: nodejs#67780 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com>
Signed-off-by: Tim Perry <pimterry@gmail.com> PR-URL: nodejs#67781 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Signed-off-by: Tim Perry <pimterry@gmail.com> PR-URL: nodejs#67781 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Signed-off-by: Tim Perry <pimterry@gmail.com> PR-URL: nodejs#67781 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Signed-off-by: Filip Skokan <panva.ip@gmail.com> PR-URL: nodejs#67781 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
The loong64, ppc64, riscv64, and s390x fast trampoline emitters each duplicated the signature validation, executable memory allocation, cache flush and mprotect sequence, trampoline release, and (for the fixed-width 32-bit ISAs) the instruction word emitters. Move them into a shared scalar_trampoline.h header so each platform file only contains its architecture-specific instruction encoding. Assisted-by: Claude Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#67496 Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
The System V and Win64 halves of the x64 fast trampoline emitter each defined identical copies of the register constants, the byte/word emitters, the REX/ModRM, mov, call, jmp, stack adjustment, and ret encoders, and the narrow return normalization helpers. Define them once ahead of the ABI-specific code. Assisted-by: Claude Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#67496 Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
napi_create_error(), napi_create_type_error(), napi_create_range_error() and node_api_create_syntax_error() differed only in the v8::Exception factory used, as did the corresponding napi_throw_*() functions. Move the bodies into internal CreateError() and ThrowError() helpers that take the factory. The exported functions and their signatures are unchanged, so there is no ABI impact. Assisted-by: Claude Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#67496 Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
DynamicLibrary::UnregisterCallback(), RefCallback(), and UnrefCallback() each duplicated the closed-library check, pointer argument validation, and callback map lookup. Move them into a shared FindCallback() helper. Assisted-by: Claude Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#67496 Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
The network and DOM storage agents repeated the same pattern dozens of times: read a property with an ObjectGet*() helper and throw a "Missing <name> in event" TypeError if it was absent. Add ObjectGetRequired() overloads that combine the two, move the duplicated ThrowEventError() into inspector_object_utils, and use them throughout both agents. Error messages are unchanged. Assisted-by: Claude Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#67496 Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
The SetMethod(), SetFastMethod(), SetMethodNoSideEffect(), SetProtoMethod(), SetInstanceMethod(), and SetProto*Dispose() variants each repeated the same function template construction, internalized name string creation, and installation code, differing only in side effect type, receiver signature, and target. Factor that into a small set of internal helpers. Assisted-by: Claude Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#67496 Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
When the creation context of the import.meta object has no associated Realm, the getter threw ERR_INVALID_INVOCATION but then fell through and dereferenced the null Realm. Return after throwing, as the other error paths in the getter already do. Assisted-by: Claude Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#67496 Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
ImportMetaResolveLazyGetter() and PathHelpersLazyGetter() duplicated the code that retrieves the creation context from the holder object. Move it into a shared GetHolderCreationContext() helper. Assisted-by: Claude Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#67496 Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
All three callers of report::WriteNodeReport() computed the excludeNetwork and excludeEnv options the same way, falling back to the process-wide defaults when there is no Environment. Do that once inside WriteNodeReport() instead. Assisted-by: Claude Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#67496 Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
FastHas() duplicated the scope parsing in FastHasResource(). Move the shared logic into FastHasImpl(), with FastHas() passing an empty resource. Assisted-by: Claude Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#67496 Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
StreamBase::WriteBuffer() and WriteString() duplicated the code that creates a request object when needed and attaches the handle being sent over an IPC pipe. Move it into a shared PrepareSendHandle() helper. Assisted-by: Claude Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#67496 Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Avoid extra UTF-8 copies on constructor, test, and exec; convert regexp inputs with ToV8Value; and assign URLPatternInit fields by interned key instead of string-comparing each component name. Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com> Assisted-by: Cursor
cursor
Bot
force-pushed
the
cursor/urlpattern-performance-603e
branch
from
November 28, 2026 01:47
1ba9273 to
5e3d9a2
Compare
The fast path looked up component names in component order, so constructing a URLPattern from an object invoked getters as protocol, username, password, and so on. WebIDL requires lexicographical order, which test/parallel/test-urlpattern.js checks. That test failed on every platform. Also put the baseURL conversion on one line so clang-format is clean. Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com> Assisted-by: Cursor Co-authored-by: Yagiz Nizipli <anonrig@users.noreply.github.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.
This speeds up WHATWG
URLPatternconstructor,test(), andexec()without changing observable behavior.Independent of the
new URL()parse PR (nodejs#65361) and theURLSearchParamsPR (nodejs#65363).What changed
C++ only (
src/node_url_pattern.cc):ValueView+memcpyinto a stack buffer and pass astring_viewinto Ada. Drop the extrastd::stringcopy thatBufferValue/Utf8Value::ToString()used to make. Non-ASCII still goes throughUtf8Value.ToV8Valueand useisolate->GetCurrentContext()instead ofEnvironment::GetCurrent.test/exec: share argument parsing so both paths keep the same WebIDL null/undefined/"null"baseURL behavior.Ada still owns its parsed state;
string_views only live for the duration of the C++ call.ValueViewis destroyed before any V8 heap allocation.Tests
test/parallel/test-urlpattern.js,test-urlpattern-types.js,test-urlpattern-invalidthis.js, andtest-urlpattern-fast-path.jsall passtest/wpt/test-urlpattern.js: 743 passed, 0 unexpected failuresReview follow-up
NewStringFromUtf8Viewhelper in favor ofToV8ValueCopyV8StringToBuffertakes a pointer, matching project convention for mutating argumentsSigned-off-byare Yagiz Nizipli (human DCO)Assisted-by: Cursor