Skip to content

perf: drop promise layers around transactions - #500

Open
chrispader wants to merge 1 commit into
async-overhead/batch-promise-layersfrom
async-overhead/transaction-promise-layers
Open

chrispader wants to merge 1 commit into
async-overhead/batch-promise-layersfrom
async-overhead/transaction-promise-layers

Conversation

@chrispader

@chrispader chrispader commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

db.transaction() and the transaction() helper were async functions that only forwarded the queue's promise, so every transaction settled through two extra promises and their microtask turns. Both now return the queue's promise directly and still reject, rather than throw, when the database is not open. The transaction callback stays async, because it commits or rolls back after awaiting.

🤖 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

The connection's transaction method and the transaction function were async wrappers around the queued operation, so every transaction resolved through two extra promises. Both now return the queue's promise directly and still reject, rather than throw, when the database is not open. The transaction callback stays async because it commits or rolls back after awaiting.

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

This branch was successfully deployed

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