sqlite: avoid extra copy for large text binds#61580
Merged
nodejs-github-bot merged 1 commit intonodejs:mainfrom Feb 7, 2026
Merged
sqlite: avoid extra copy for large text binds#61580nodejs-github-bot merged 1 commit intonodejs:mainfrom
nodejs-github-bot merged 1 commit intonodejs:mainfrom
Conversation
Collaborator
|
Review requested:
|
ea75fcc to
b7abb6f
Compare
Contributor
Author
|
Benchmarks (local, macOS, Release build) Compared with base branch (main) Summary:
change primarily improves large text binds; other workloads appear neutral within measurement noise. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #61580 +/- ##
==========================================
- Coverage 89.78% 89.77% -0.01%
==========================================
Files 673 673
Lines 203775 203852 +77
Branches 39166 39181 +15
==========================================
+ Hits 182956 183017 +61
- Misses 13139 13153 +14
- Partials 7680 7682 +2
🚀 New features to boost your workflow:
|
92bb01c to
8e4016b
Compare
When binding UTF-8 strings to prepared statements, transfer ownership of malloc-backed Utf8Value buffers to SQLite to avoid an extra copy for large strings. Use sqlite3_bind_blob64() when binding BLOB parameters.
8e4016b to
da58cfd
Compare
Contributor
Author
|
Hi @Renegade334 and @mcollina When you have a moment, could you please take a look at this PR and share your feedback? Thanks so much! |
Collaborator
Contributor
Author
|
HI @mcollina some flaky tests failed, is it ready to merge? |
geeksilva97
approved these changes
Feb 5, 2026
Collaborator
Contributor
Author
|
All CI passed @geeksilva97 should it be merged? |
Renegade334
approved these changes
Feb 7, 2026
himself65
approved these changes
Feb 7, 2026
Contributor
yep. let's do this |
Collaborator
|
Landed in 346ad95 |
aduh95
pushed a commit
that referenced
this pull request
Feb 8, 2026
When binding UTF-8 strings to prepared statements, transfer ownership of malloc-backed Utf8Value buffers to SQLite to avoid an extra copy for large strings. Use sqlite3_bind_blob64() when binding BLOB parameters. PR-URL: #61580 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com> Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
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.
Summary
Utf8Valuebuffer to SQLite to avoid an extra copy for larger strings.sqlite3_bind_blob64()for BLOB parameters to avoid truncation for larger payloads.