Skip to content

perf: drop promise layers from batch and file loading - #499

Open
chrispader wants to merge 1 commit into
async-overhead/load-file-rejectionfrom
async-overhead/batch-promise-layers
Open

chrispader wants to merge 1 commit into
async-overhead/load-file-rejectionfrom
async-overhead/batch-promise-layers

Conversation

@chrispader

@chrispader chrispader commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

#496 removed the async wrappers from executeAsync(), but executeBatchAsync() and loadFileAsync() still wrapped the native promise in up to three async functions. Each layer creates a promise, and an async function that returns another promise needs two extra microtask turns to settle. Both methods now return the queued native promise directly.

A new callNativeAsync() helper still reports a synchronous native throw as a rejected NitroSQLiteError, and executeRawAsyncNative() uses it too. It lives in nativePromise.ts with rejectWithNitroSQLiteError(), which moves out of execute.ts, since neither is specific to running queries.

🤖 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

executeBatchAsync, the connection's executeBatchAsync and loadFileAsync wrapped the native promise in async functions, the same layers #496 removed from executeAsync. They now return the queued native promise directly. callNativeAsync keeps reporting a synchronous native throw as a rejected NitroSQLiteError, and executeRawAsyncNative uses it too. It lives with rejectWithNitroSQLiteError in nativePromise.ts, since neither is specific to executing queries.

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

This branch was successfully deployed

1 active deployment
Preview — b2932cea 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