Various perf improvements#425
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR focuses on performance-oriented refactors across the JS/TS wrapper and the native C++ bridge, aiming to reduce unnecessary work (notably around result materialization and argument handling) and to improve publish/release behavior for prerelease tags.
Changes:
- Simplified JS-side DB wrappers and formatting updates, relying more directly on the native result shape (notably for
executeSync). - Native-side tuning in C++ utilities/bridge (reduced allocations, early returns for empty rows, safer param handling).
- Release workflow updated to publish prereleases under a dist-tag; examples/tests adjusted to match the new result behavior.
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Storage.ts | Formatting + minor safety tweak for sync row access. |
| src/functions.ts | Wrapper refactor; executeSync now delegates directly to the host object. |
| README.md | Updates benchmark image reference. |
| package.json | JSON formatting + repository field normalized to object form. |
| example/src/tests/storage.ts | Test description text changed. |
| example/src/tests/queries.ts | Test updated to assume rows is always present. |
| example/src/performance_test.ts | Adds an additional insert/select benchmark helper. |
| example/src/App.tsx | Updates perf import and comments out the perf run block. |
| cpp/utils.cpp | Micro-optimizations (moves, reserves) + faster empty-row handling. |
| cpp/DBHostObject.cpp | Avoids treating null/undefined params as arrays in executeSync. |
| cpp/bridge.cpp | Changes statement handling/allocation strategy; tracks affected rows/insert id during stepping. |
| .github/workflows/release.yml | Publishes prereleases with a dist-tag based on tag suffix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Various improvements to avoid work and fine-tuning, specially around inline functions on android.
Which makes this again the fastest lib on rn :) maybe not by much on functions that do not return anything but for sure on function calls that return data.