Skip to content

perf: run prepared async executions on the connection worker - #503

Open
chrispader wants to merge 1 commit into
async-overhead/idle-queue-fast-pathfrom
async-overhead/prepared-connection-worker
Open

chrispader wants to merge 1 commit into
async-overhead/idle-queue-fast-pathfrom
async-overhead/prepared-connection-worker

Conversation

@chrispader

@chrispader chrispader commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

A prepared statement's executeAsync() and executeRawAsync() ran on Nitro's shared thread pool, which does not keep call order. The JavaScript queue therefore ran them as exclusive operations, so each execution waited for the previous result, and other async calls on the connection waited too.

They now run on the connection's own worker thread like db.executeAsync(), which runs calls one at a time in call order. The queue treats them as statements, so several executions can be submitted without waiting for each result.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
react-native-nitro-sqlite Ready Ready Preview Nov 16, 2026 4:34pm UTC

Request Review

A prepared statement's executeAsync and executeRawAsync ran on Nitro's shared thread pool, which does not keep call order, so the JavaScript queue had to run them one at a time and every execution waited for the previous result. They now run on the connection's FIFO worker like executeAsync, and the queue treats them as statements, so several can be submitted without waiting. The worker still runs them one at a time in call order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — 0a54af97 Deployed Nov 16, 2026 by vercel[bot]
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.

1 participant