Skip to content

Conversation

@mertcanaltin
Copy link
Member

@mertcanaltin mertcanaltin commented Jan 18, 2026

Reduce allocation overhead in run() result object creation by caching DictionaryTemplate.
Improves INSERT performance by ~17–24%, SELECT performance remains unchanged.

results:

➜  node git:(mert/sqlite-optimize-run-result) ✗ node-benchmark-compare ./result.csv
                                                                                                                                                              confidence improvement accuracy (*)    (**)   (***)
sqlite/sqlite-is-transaction.js transaction='false' n=10000000                                                                                                               -5.98 %       ±7.16%  ±9.88% ±13.61%
sqlite/sqlite-is-transaction.js transaction='true' n=10000000                                                                                                                 0.13 %       ±1.57%  ±2.15%  ±2.93%
sqlite/sqlite-prepare-insert.js statement='INSERT INTO all_column_types (text_column, integer_column, real_column, blob_column) VALUES (?, ?, ?, ?)' n=100000        ***     17.24 %       ±1.15%  ±1.59%  ±2.22%
sqlite/sqlite-prepare-insert.js statement='INSERT INTO blob_column_type (blob_column) VALUES (?)' n=100000                                                           ***     22.91 %       ±1.25%  ±1.71%  ±2.33%
sqlite/sqlite-prepare-insert.js statement='INSERT INTO integer_column_type (integer_column) VALUES (?)' n=100000                                                     ***     23.71 %       ±1.36%  ±1.87%  ±2.57%
sqlite/sqlite-prepare-insert.js statement='INSERT INTO large_text (text_8kb_column) VALUES (?)' n=100000                                                                     -1.50 %       ±6.67%  ±9.29% ±12.99%
sqlite/sqlite-prepare-insert.js statement='INSERT INTO missing_required_value (any_value, required_value) VALUES (?, ?)' n=100000                                            -1.17 %       ±1.97%  ±2.72%  ±3.75%
sqlite/sqlite-prepare-insert.js statement='INSERT INTO real_column_type (real_column) VALUES (?)' n=100000                                                           ***     21.04 %       ±1.43%  ±2.01%  ±2.84%
sqlite/sqlite-prepare-insert.js statement='INSERT INTO text_column_type (text_column) VALUES (?)' n=100000                                                           ***     19.58 %       ±1.41%  ±1.95%  ±2.68%
sqlite/sqlite-prepare-select-all.js statement='SELECT * FROM foo LIMIT 1' tableSeedSize=100000 n=100000                                                                       3.78 %       ±9.61% ±13.77% ±20.18%
sqlite/sqlite-prepare-select-all.js statement='SELECT * FROM foo LIMIT 100' tableSeedSize=100000 n=100000                                                                    -0.40 %       ±1.60%  ±2.20%  ±3.00%
sqlite/sqlite-prepare-select-all.js statement='SELECT 1' tableSeedSize=100000 n=100000                                                                                       -1.97 %       ±4.19%  ±5.83%  ±8.14%
sqlite/sqlite-prepare-select-all.js statement='SELECT text_8kb_column FROM foo_large LIMIT 1' tableSeedSize=100000 n=100000                                                   4.02 %       ±8.16% ±11.59% ±16.73%
sqlite/sqlite-prepare-select-all.js statement='SELECT text_8kb_column FROM foo_large LIMIT 100' tableSeedSize=100000 n=100000                                                 1.32 %       ±2.78%  ±3.88%  ±5.44%
sqlite/sqlite-prepare-select-all.js statement='SELECT text_column FROM foo LIMIT 1' tableSeedSize=100000 n=100000                                                     **     -2.76 %       ±1.66%  ±2.29%  ±3.16%
sqlite/sqlite-prepare-select-all.js statement='SELECT text_column FROM foo LIMIT 100' tableSeedSize=100000 n=100000                                                           0.59 %       ±0.96%  ±1.32%  ±1.80%
sqlite/sqlite-prepare-select-all.js statement='SELECT text_column, integer_column FROM foo LIMIT 1' tableSeedSize=100000 n=100000                                      *     -2.37 %       ±2.28%  ±3.15%  ±4.36%
sqlite/sqlite-prepare-select-all.js statement='SELECT text_column, integer_column FROM foo LIMIT 100' tableSeedSize=100000 n=100000                                           0.71 %       ±2.21%  ±3.05%  ±4.22%
sqlite/sqlite-prepare-select-all.js statement='SELECT text_column, integer_column, real_column FROM foo LIMIT 1' tableSeedSize=100000 n=100000                               -1.15 %       ±2.02%  ±2.77%  ±3.79%
sqlite/sqlite-prepare-select-all.js statement='SELECT text_column, integer_column, real_column FROM foo LIMIT 100' tableSeedSize=100000 n=100000                              0.53 %       ±1.93%  ±2.72%  ±3.87%
sqlite/sqlite-prepare-select-all.js statement='SELECT text_column, integer_column, real_column, blob_column FROM foo LIMIT 1' tableSeedSize=100000 n=100000           **      1.87 %       ±1.31%  ±1.80%  ±2.45%
sqlite/sqlite-prepare-select-all.js statement='SELECT text_column, integer_column, real_column, blob_column FROM foo LIMIT 100' tableSeedSize=100000 n=100000                 1.26 %       ±2.84%  ±3.94%  ±5.49%
sqlite/sqlite-prepare-select-get.js statement='SELECT * FROM foo LIMIT 1' tableSeedSize=100000 n=100000                                                                       0.83 %       ±1.37%  ±1.88%  ±2.56%
sqlite/sqlite-prepare-select-get.js statement='SELECT 1' tableSeedSize=100000 n=100000                                                                                       -0.22 %       ±1.32%  ±1.83%  ±2.54%
sqlite/sqlite-prepare-select-get.js statement='SELECT text_8kb_column FROM foo_large LIMIT 1' tableSeedSize=100000 n=100000                                            *      1.40 %       ±1.04%  ±1.42%  ±1.93%
sqlite/sqlite-prepare-select-get.js statement='SELECT text_column FROM foo LIMIT 1' tableSeedSize=100000 n=100000                                                             1.17 %       ±1.71%  ±2.36%  ±3.25%
sqlite/sqlite-prepare-select-get.js statement='SELECT text_column, integer_column FROM foo LIMIT 1' tableSeedSize=100000 n=100000                                            -5.25 %      ±10.77% ±15.42% ±22.57%
sqlite/sqlite-prepare-select-get.js statement='SELECT text_column, integer_column, real_column FROM foo LIMIT 1' tableSeedSize=100000 n=100000                                0.18 %       ±1.46%  ±2.01%  ±2.74%
sqlite/sqlite-prepare-select-get.js statement='SELECT text_column, integer_column, real_column, blob_column FROM foo LIMIT 1' tableSeedSize=100000 n=100000                   0.49 %       ±1.81%  ±2.51%  ±3.48%

Be aware that when doing many comparisons the risk of a false-positive result increases.
In this case, there are 29 comparisons, you can thus expect the following amount of false-positive results:
  1.45 false positives, when considering a   5% risk acceptance (*, **, ***),
  0.29 false positives, when considering a   1% risk acceptance (**, ***),
  0.03 false positives, when considering a 0.1% risk acceptance (***)
➜  node git:(mert/sqlite-optimize-run-result) ✗ 

@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 18, 2026
@codecov
Copy link

codecov bot commented Jan 18, 2026

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 88.51%. Comparing base (637bda0) to head (232e932).
⚠️ Report is 157 commits behind head on main.

Files with missing lines Patch % Lines
src/node_sqlite.cc 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #61432   +/-   ##
=======================================
  Coverage   88.51%   88.51%           
=======================================
  Files         704      704           
  Lines      208883   208884    +1     
  Branches    40334    40326    -8     
=======================================
+ Hits       184890   184894    +4     
+ Misses      15977    15971    -6     
- Partials     8016     8019    +3     
Files with missing lines Coverage Δ
src/node_sqlite.cc 80.22% <88.88%> (+0.05%) ⬆️

... and 32 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.

@avivkeller avivkeller added needs-benchmark-ci PR that need a benchmark CI run. request-ci Add this label to start a Jenkins CI on a PR. labels Jan 19, 2026
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 19, 2026
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@geeksilva97 geeksilva97 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 20, 2026
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@addaleax addaleax added the commit-queue Add this label to land a pull request using GitHub Actions. label Feb 5, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Feb 5, 2026
@nodejs-github-bot nodejs-github-bot merged commit e7d6728 into nodejs:main Feb 5, 2026
87 of 88 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in e7d6728

aduh95 pushed a commit that referenced this pull request Feb 8, 2026
PR-URL: #61432
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
aduh95 pushed a commit that referenced this pull request Feb 10, 2026
PR-URL: #61432
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Feb 11, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [node](https://nodejs.org) ([source](https://github.com/nodejs/node)) | patch | `25.6.0` → `25.6.1` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>nodejs/node (node)</summary>

### [`v25.6.1`](https://github.com/nodejs/node/releases/tag/v25.6.1): 2026-02-10, Version 25.6.1 (Current), @&#8203;aduh95

[Compare Source](nodejs/node@v25.6.0...v25.6.1)

##### Notable Changes

- \[[`47df4328d7`](nodejs/node@47df4328d7)] - **build,deps**: replace `cjs-module-lexer` with `merve` (Yagiz Nizipli) [#&#8203;61456](nodejs/node#61456)

##### Commits

- \[[`47df4328d7`](nodejs/node@47df4328d7)] - **build,deps**: replace cjs-module-lexer with merve (Yagiz Nizipli) [#&#8203;61456](nodejs/node#61456)
- \[[`a727054503`](nodejs/node@a727054503)] - **deps**: upgrade npm to 11.9.0 (npm team) [#&#8203;61685](nodejs/node#61685)
- \[[`c78c49ed6b`](nodejs/node@c78c49ed6b)] - **deps**: update amaro to 1.1.7 (Node.js GitHub Bot) [#&#8203;61730](nodejs/node#61730)
- \[[`4790816d9b`](nodejs/node@4790816d9b)] - **deps**: update minimatch to 10.1.2 (Node.js GitHub Bot) [#&#8203;61732](nodejs/node#61732)
- \[[`8c71740e8a`](nodejs/node@8c71740e8a)] - **deps**: update undici to 7.21.0 (Node.js GitHub Bot) [#&#8203;61683](nodejs/node#61683)
- \[[`e559ef6ab1`](nodejs/node@e559ef6ab1)] - **deps**: update googletest to [`56efe39`](nodejs/node@56efe39) (Node.js GitHub Bot) [#&#8203;61605](nodejs/node#61605)
- \[[`300de2bb5a`](nodejs/node@300de2bb5a)] - **deps**: update amaro to 1.1.6 (Node.js GitHub Bot) [#&#8203;61603](nodejs/node#61603)
- \[[`e71e9505ef`](nodejs/node@e71e9505ef)] - **dns**: fix Windows SRV ECONNREFUSED by adjusting c-ares fallback detection (notvivek12) [#&#8203;61453](nodejs/node#61453)
- \[[`439b816bc7`](nodejs/node@439b816bc7)] - **doc**: clarify EventEmitter error handling in threat model (Matteo Collina) [#&#8203;61701](nodejs/node#61701)
- \[[`c1c6641f23`](nodejs/node@c1c6641f23)] - **doc**: mention default option for test runner env (Steven) [#&#8203;61659](nodejs/node#61659)
- \[[`41ec451f98`](nodejs/node@41ec451f98)] - **doc**: fix --inspect security warning section (Tim Perry) [#&#8203;61675](nodejs/node#61675)
- \[[`bb90ef2356`](nodejs/node@bb90ef2356)] - **doc**: document `url.format(urlString)` as deprecated under DEP0169 (René) [#&#8203;61644](nodejs/node#61644)
- \[[`513df82e6f`](nodejs/node@513df82e6f)] - **doc**: update to Visual Studio 2026 manual install (Mike McCready) [#&#8203;61655](nodejs/node#61655)
- \[[`9409d30736`](nodejs/node@9409d30736)] - **doc**: deprecation add more codemod (Augustin Mauroy) [#&#8203;61642](nodejs/node#61642)
- \[[`75a7a67151`](nodejs/node@75a7a67151)] - **doc**: fix grammatical error in README.md (ayj8201) [#&#8203;61653](nodejs/node#61653)
- \[[`821e59e884`](nodejs/node@821e59e884)] - **doc**: correct tools README Boxstarter link (Mike McCready) [#&#8203;61638](nodejs/node#61638)
- \[[`4998f539a0`](nodejs/node@4998f539a0)] - **doc**: update `server.dropMaxConnection` link (YuSheng Chen) [#&#8203;61584](nodejs/node#61584)
- \[[`9383ac4ab7`](nodejs/node@9383ac4ab7)] - **http**: implement slab allocation for HTTP header parsing (Mert Can Altin) [#&#8203;61375](nodejs/node#61375)
- \[[`e90eb1d561`](nodejs/node@e90eb1d561)] - **meta**: persist sccache daemon until end of build workflows (René) [#&#8203;61639](nodejs/node#61639)
- \[[`ade36ac367`](nodejs/node@ade36ac367)] - **meta**: bump github/codeql-action from 4.31.9 to 4.32.0 (dependabot\[bot]) [#&#8203;61622](nodejs/node#61622)
- \[[`26638bd67f`](nodejs/node@26638bd67f)] - **meta**: bump step-security/harden-runner from 2.14.0 to 2.14.1 (dependabot\[bot]) [#&#8203;61621](nodejs/node#61621)
- \[[`eaa9a96cb6`](nodejs/node@eaa9a96cb6)] - **meta**: bump actions/setup-python from 6.1.0 to 6.2.0 (dependabot\[bot]) [#&#8203;61627](nodejs/node#61627)
- \[[`fd98187828`](nodejs/node@fd98187828)] - **meta**: bump cachix/cachix-action (dependabot\[bot]) [#&#8203;61626](nodejs/node#61626)
- \[[`820c1d021c`](nodejs/node@820c1d021c)] - **meta**: bump actions/setup-node from 6.1.0 to 6.2.0 (dependabot\[bot]) [#&#8203;61625](nodejs/node#61625)
- \[[`72a4136bd5`](nodejs/node@72a4136bd5)] - **meta**: bump actions/cache from 5.0.1 to 5.0.3 (dependabot\[bot]) [#&#8203;61624](nodejs/node#61624)
- \[[`e3ef6cb3bc`](nodejs/node@e3ef6cb3bc)] - **meta**: bump peter-evans/create-pull-request from 8.0.0 to 8.1.0 (dependabot\[bot]) [#&#8203;61623](nodejs/node#61623)
- \[[`020a836202`](nodejs/node@020a836202)] - **meta**: bump actions/stale from 10.1.0 to 10.1.1 (dependabot\[bot]) [#&#8203;61620](nodejs/node#61620)
- \[[`0df72f07c8`](nodejs/node@0df72f07c8)] - **meta**: bump actions/checkout from 6.0.1 to 6.0.2 (dependabot\[bot]) [#&#8203;61619](nodejs/node#61619)
- \[[`d147c08b83`](nodejs/node@d147c08b83)] - **module**: do not invoke resolve hooks twice for imported cjs (Joyee Cheung) [#&#8203;61529](nodejs/node#61529)
- \[[`a2843f8556`](nodejs/node@a2843f8556)] - **net**: defer synchronous destroy calls in internalConnect (RajeshKumar11) [#&#8203;61658](nodejs/node#61658)
- \[[`7fb7030781`](nodejs/node@7fb7030781)] - **repl**: fix flaky test-repl-programmatic-history (Matteo Collina) [#&#8203;61614](nodejs/node#61614)
- \[[`d4c9b5cf5b`](nodejs/node@d4c9b5cf5b)] - **sqlite**: avoid extra copy for large text binds (Ali Hassan) [#&#8203;61580](nodejs/node#61580)
- \[[`aa1b3661d9`](nodejs/node@aa1b3661d9)] - **sqlite**: use DictionaryTemplate for run() result (Mert Can Altin) [#&#8203;61432](nodejs/node#61432)
- \[[`9c8ad7e881`](nodejs/node@9c8ad7e881)] - **src**: elide heap allocation in structured clone implementation (Anna Henningsen) [#&#8203;61703](nodejs/node#61703)
- \[[`c4ecfef93d`](nodejs/node@c4ecfef93d)] - **src**: use simdutf for one-byte string UTF-8 write in stringBytes (Mert Can Altin) [#&#8203;61696](nodejs/node#61696)
- \[[`28905b9734`](nodejs/node@28905b9734)] - **src**: consolidate C++ ReadFileSync/WriteFileSync utilities (Joyee Cheung) [#&#8203;61662](nodejs/node#61662)
- \[[`e90cec2f69`](nodejs/node@e90cec2f69)] - **test**: restraint version replacement pattern in snapshots (Chengzhong Wu) [#&#8203;61748](nodejs/node#61748)
- \[[`adce20c0a1`](nodejs/node@adce20c0a1)] - **test**: print stack immediately avoiding GC interleaving (Chengzhong Wu) [#&#8203;61699](nodejs/node#61699)
- \[[`7643bc8999`](nodejs/node@7643bc8999)] - **test**: fix case-insensitive path matching on Windows (Matteo Collina) [#&#8203;61682](nodejs/node#61682)
- \[[`23d1ecf66f`](nodejs/node@23d1ecf66f)] - **test**: fix flaky test-performance-eventloopdelay (Matteo Collina) [#&#8203;61629](nodejs/node#61629)
- \[[`99012a88ed`](nodejs/node@99012a88ed)] - **test**: remove duplicate wpt tests (Filip Skokan) [#&#8203;61617](nodejs/node#61617)
- \[[`a8b32b8ce1`](nodejs/node@a8b32b8ce1)] - **test**: fix race condition in watch mode tests (Matteo Collina) [#&#8203;61615](nodejs/node#61615)
- \[[`086a5a5a25`](nodejs/node@086a5a5a25)] - **test**: update WPT for url to [`e3c46fd`](nodejs/node@e3c46fdf55) (Node.js GitHub Bot) [#&#8203;61602](nodejs/node#61602)
- \[[`f0574fd419`](nodejs/node@f0574fd419)] - **test**: use the skipIfNoWatch() utility function (Luigi Pinca) [#&#8203;61531](nodejs/node#61531)
- \[[`b064ddc221`](nodejs/node@b064ddc221)] - **test**: unify assertSnapshot common patterns (Chengzhong Wu) [#&#8203;61590](nodejs/node#61590)
- \[[`17122e521b`](nodejs/node@17122e521b)] - **test\_runner**: fix test enqueue when test file has syntax error (Edy Silva) [#&#8203;61573](nodejs/node#61573)
- \[[`bad3f02dd9`](nodejs/node@bad3f02dd9)] - **tools**: enforce removal of `lts-watch-*` labels on release proposals (Antoine du Hamel) [#&#8203;61672](nodejs/node#61672)
- \[[`a8f33fd6bd`](nodejs/node@a8f33fd6bd)] - **tools**: use ubuntu-slim runner in meta GitHub Actions (Tierney Cyren) [#&#8203;61663](nodejs/node#61663)
- \[[`c843e447ca`](nodejs/node@c843e447ca)] - **tools**: test `--shared-merve` in `test-shared` workflow (Antoine du Hamel) [#&#8203;61649](nodejs/node#61649)
- \[[`2fedc03f96`](nodejs/node@2fedc03f96)] - **tools**: update OpenSSL to 3.5.5 in `test-shared` (Antoine du Hamel) [#&#8203;61551](nodejs/node#61551)
- \[[`1c1db94670`](nodejs/node@1c1db94670)] - **tools,win**: upgrade install additional tools to Visual Studio 2026 (Mike McCready) [#&#8203;61562](nodejs/node#61562)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi45Ny4wIiwidXBkYXRlZEluVmVyIjoiNDIuOTcuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6OnBhdGNoIl19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. needs-benchmark-ci PR that need a benchmark CI run. 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.

6 participants