Repository navigation
perf: send row batches to one registered handler - #504
Open
chrispader wants to merge 1 commit into
Open
chrispader wants to merge 1 commit into
chrispader wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
chrispader
force-pushed
the
async-overhead/row-batch-handler
branch
from
November 16, 2026 15:30
d55abec to
da255d4
Compare
Every managed executeAsync passed a new onRows callback to native code, even though native only calls it for results of 256 rows or more. Nitro converts each callback to a native function and keeps a weak reference to it in its JSI cache, which is never pruned. The managed API now sets one handler with setRowBatchHandler and passes a numeric row batch ID per query. Native builds without the handler still get a callback per query. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chrispader
force-pushed
the
async-overhead/row-batch-handler
branch
from
November 16, 2026 16:33
da255d4 to
51ed4eb
Compare
This branch was successfully deployed
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.
Every managed
executeAsync()passed a newonRowscallback to native code, although native code only calls it for results of 256 rows or more. Nitro converts each callback into a native function and adds a weak reference to it to its JSI cache, which it never prunes, so every query pays for the conversion and the cache grows with the number of queries. In a per-call probe on an iPhone 14 Pro, passing the callback raised the cost of 250 point reads in flight from about 36 to about 54 µs per read.The managed API now sets one handler with the new
setRowBatchHandler()native method and passes a numericrowBatchIdper query instead. Native builds withoutsetRowBatchHandler()still get a callback per query.🤖 Generated with Claude Code