Skip to content

Conversation

@thisalihassan
Copy link
Contributor

@thisalihassan thisalihassan commented Jan 29, 2026

Summary

  • When binding UTF-8 strings to SQLite statements, transfer ownership of the malloc-backed Utf8Value buffer to SQLite to avoid an extra copy for larger strings.
  • Use sqlite3_bind_blob64() for BLOB parameters to avoid truncation for larger payloads.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/sqlite

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. sqlite Issues and PRs related to the SQLite subsystem. labels Jan 29, 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.
@thisalihassan thisalihassan force-pushed the sqlite-bind-text64-avoid-copy branch from ea75fcc to b7abb6f Compare January 29, 2026 21:00
@thisalihassan
Copy link
Contributor Author

Benchmarks (local, macOS, Release build)

Compared with base branch (main)

Summary:

  • INSERT INTO large_text (text_8kb_column) VALUES (?): *** +5.30% (±1.42%)
  • Other insert cases: within ~±1% (not significant), except all_column_types -0.77% (*) (±0.77%)

change primarily improves large text binds; other workloads appear neutral within measurement noise.

@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

❌ Patch coverage is 65.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.78%. Comparing base (37e4004) to head (b7abb6f).
⚠️ Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
src/node_sqlite.cc 65.00% 6 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #61580   +/-   ##
=======================================
  Coverage   89.78%   89.78%           
=======================================
  Files         673      673           
  Lines      203775   203852   +77     
  Branches    39166    39189   +23     
=======================================
+ Hits       182956   183030   +74     
- Misses      13139    13156   +17     
+ Partials     7680     7666   -14     
Files with missing lines Coverage Δ
src/node_sqlite.cc 80.46% <65.00%> (-0.20%) ⬇️

... and 47 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. sqlite Issues and PRs related to the SQLite subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants