GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — sqlite: use shared-shape objects for result rows by araujogui · Pull Request #66385 · nodejs/node

Conversation

@araujogui

@araujogui araujogui commented Sep 28, 2026

Copy link
Copy Markdown
Member

all(), get() and iterate() built each row with the Object::New() overload that takes names and values. That overload always returns a dictionary-mode object, so no two rows shared a map and every property read was a hash lookup.

Rows are now built from a DictionaryTemplate cached on the statement and invalidated on re-prepare. Rows keep their null prototype. Statements whose column names a template can't express (array indices, duplicates, non-ASCII names, which the template interns as Latin-1) or with more than 64 columns keep the previous path.

Adds benchmark/sqlite/sqlite-prepare-select-read.js, which reads every column of each row, since the existing benchmarks only measure building rows.

Fixes: #65799

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Copilot AI balanced review requested due to automatic review settings September 28, 2026 23:40
@nodejs-github-bot

nodejs-github-bot commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/performance
  • @nodejs/sqlite
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot AI reviewed Sep 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@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 Sep 28, 2026
@codecov

codecov Bot commented Sep 29, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.00000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.46%. Comparing base (9746ebc) to head (46793f9).
⚠️ Report is 135 commits behind head on main.

Files with missing lines Patch % Lines
src/node_sqlite.cc 85.00% 4 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #66385      +/-   ##
==========================================
+ Coverage   90.40%   90.46%   +0.06%     
==========================================
  Files         791      791              
  Lines      276120   276682     +562     
  Branches    53022    53412     +390     
==========================================
+ Hits       249618   250314     +696     
+ Misses      16897    16768     -129     
+ Partials     9605     9600       -5     
Files with missing lines Coverage Δ
src/node_sqlite.h 87.27% <ø> (ø)
src/node_sqlite.cc 82.14% <85.00%> (+0.24%) ⬆️

... and 38 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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@araujogui araujogui added the needs-benchmark-ci PRs that need a benchmark CI run. label Sep 29, 2026
@colinhacks colinhacks mentioned this pull request Oct 1, 2026
node-api: objects from node_api_create_object_with_properties are in dictionary mode #66441
Open
@araujogui
araujogui requested a review from trivikr October 5, 2026 14:42
@trivikr

trivikr commented Oct 5, 2026

Copy link
Copy Markdown
Member

@araujogui Can you run the benchmark CI and post output here?

CI currently fails on summarizing the output. You can copy the raw output and summarize it locally.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@araujogui
sqlite: use shared-shape objects for result rows
46793f9
`all()`, `get()` and `iterate()` built each row with the
`Object::New()` overload that takes names and values. That overload
always returns a dictionary-mode object, so no two rows shared a map
and every property read was a hash lookup.

Build rows from a `DictionaryTemplate` cached on the statement in place
of the column names, invalidated on re-prepare. Rows keep their null
prototype. Statements whose column names a template cannot express
(array indices, duplicates, non-ASCII names, which the template
interns as Latin-1) or with more than 64 columns keep the previous
path.

Add a benchmark that reads every column of each row, since the
existing ones only measure building rows.

Fixes: nodejs#65799
Assisted-by: Claude
Signed-off-by: Guilherme Araújo <[email protected]>
@araujogui
araujogui force-pushed the sqlite-shared-shape-rows branch from a61d7f8 to 46793f9 Compare October 6, 2026 00:41
@ronag
ronag requested review from jasnell, joyeecheung and mcollina October 6, 2026 14:13
@mceachen mceachen mentioned this pull request Oct 6, 2026
sqlite: avoid abort on oversized SQL text #66498
Closed
@araujogui araujogui closed this Oct 6, 2026
@araujogui araujogui reopened this Oct 6, 2026
@araujogui

araujogui commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

Ops, closed PR by accident 😬

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@araujogui

araujogui commented Oct 6, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Benchmarks:

sqlite-prepare-select-read
./node-master benchmark/compare.js --set CPUSET=0-11 --analyze --old ./node-master --new ./node-pr --filter sqlite-prepare-select-read -- sqlite
                                                                                       confidence   improvement   accuracy (*)    (**)   (***)
sqlite/sqlite-prepare-select-read.js returnArrays=0 method='all' rows=1 n=10000                        -1.52 %   ±3.77%  ±5.02%  ±6.54%
sqlite/sqlite-prepare-select-read.js returnArrays=1 method='all' rows=1 n=10000                        +3.31 %   ±9.39%  ±12.50%  ±16.28%
sqlite/sqlite-prepare-select-read.js returnArrays=0 method='iterate' rows=1 n=10000    ***            +16.64 %   ±3.50%  ±4.68%  ±6.11%
sqlite/sqlite-prepare-select-read.js returnArrays=1 method='iterate' rows=1 n=10000                    -0.32 %   ±3.87%  ±5.15%  ±6.71%
sqlite/sqlite-prepare-select-read.js returnArrays=0 method='get' rows=1 n=10000          *             +8.40 %   ±7.46%  ±9.92%  ±12.91%
sqlite/sqlite-prepare-select-read.js returnArrays=1 method='get' rows=1 n=10000                        -4.07 %   ±8.53%  ±11.35%  ±14.77%
sqlite/sqlite-prepare-select-read.js returnArrays=0 method='all' rows=100 n=10000      ***            +22.85 %   ±0.46%  ±0.61%  ±0.79%
sqlite/sqlite-prepare-select-read.js returnArrays=1 method='all' rows=100 n=10000                      -0.59 %   ±0.90%  ±1.20%  ±1.56%
sqlite/sqlite-prepare-select-read.js returnArrays=0 method='iterate' rows=100 n=10000  ***            +32.78 %   ±0.52%  ±0.69%  ±0.91%
sqlite/sqlite-prepare-select-read.js returnArrays=1 method='iterate' rows=100 n=10000  ***             -1.43 %   ±0.75%  ±1.00%  ±1.31%
sqlite/sqlite-prepare-select-read.js returnArrays=0 method='get' rows=100 n=10000      ***            +12.76 %   ±6.27%  ±8.34%  ±10.87%
sqlite/sqlite-prepare-select-read.js returnArrays=1 method='get' rows=100 n=10000                      +0.06 %   ±11.41%  ±15.18%  ±19.76%

                                                                                          -33.3%             0%             +33.3%
sqlite/sqlite-prepare-select-read.js returnArrays=0 method='all' rows=1 n=10000                         ░░▓|                     -1.52% 
sqlite/sqlite-prepare-select-read.js returnArrays=1 method='all' rows=1 n=10000                        ░░░░|▓░░░░░░              +3.31% 
sqlite/sqlite-prepare-select-read.js returnArrays=0 method='iterate' rows=1 n=10000                        |█████████░░          +16.64% ***
sqlite/sqlite-prepare-select-read.js returnArrays=1 method='iterate' rows=1 n=10000                     ░░░|░                    -0.32% 
sqlite/sqlite-prepare-select-read.js returnArrays=0 method='get' rows=1 n=10000                            |████░░░░░            +8.40% *
sqlite/sqlite-prepare-select-read.js returnArrays=1 method='get' rows=1 n=10000                    ░░░░░░▓▓|░░                   -4.07% 
sqlite/sqlite-prepare-select-read.js returnArrays=0 method='all' rows=100 n=10000                          |█████████████        +22.85% ***
sqlite/sqlite-prepare-select-read.js returnArrays=1 method='all' rows=100 n=10000                         ░|                     -0.59% 
sqlite/sqlite-prepare-select-read.js returnArrays=0 method='iterate' rows=100 n=10000                      |███████████████████  +32.78% ***
sqlite/sqlite-prepare-select-read.js returnArrays=1 method='iterate' rows=100 n=10000                     █|                     -1.43% ***
sqlite/sqlite-prepare-select-read.js returnArrays=0 method='get' rows=100 n=10000                          |███████░░░           +12.76% ***
sqlite/sqlite-prepare-select-read.js returnArrays=1 method='get' rows=100 n=10000                   ░░░░░░░|░░░░░░               +0.06% 

Rates were scaled by 1000x into HdrHistogram (3 significant figures).
Use --scale to adjust precision if needed.

Be aware that when doing many comparisons the risk of a false-positive
result increases. In this case, there are 12 comparisons, you can thus
expect the following amount of false-positive results:
  0.60 false positives, when considering a   5% risk acceptance (*, **, ***),
  0.12 false positives, when considering a   1% risk acceptance (**, ***),
  0.01 false positives, when considering a 0.1% risk acceptance (***)

The stars above are per-benchmark and uncorrected. Adjusting for the size of
this comparison set (Holm-Bonferroni), 5 comparisons remain significant at 5%.
sqlite-prepare-select-all
./node-master benchmark/compare.js --set CPUSET=0-11 --analyze --old ./node-master --new ./node-pr --filter sqlite-prepare-select-all -- sqlite
                                                                                                                                                               confidence   improvement   accuracy (*)    (**)   (***)
sqlite/sqlite-prepare-select-all-options.js options='none' statement='SELECT * FROM foo LIMIT 1' tableSeedSize=100000 n=100000                                 ***             -2.37 %   ±0.69%  ±0.92%  ±1.20%
sqlite/sqlite-prepare-select-all-options.js options='readBigInts' statement='SELECT * FROM foo LIMIT 1' tableSeedSize=100000 n=100000                          ***             -1.82 %   ±0.81%  ±1.08%  ±1.41%
sqlite/sqlite-prepare-select-all-options.js options='returnArrays' statement='SELECT * FROM foo LIMIT 1' tableSeedSize=100000 n=100000                         ***             -1.74 %   ±0.62%  ±0.82%  ±1.07%
sqlite/sqlite-prepare-select-all-options.js options='readBigInts|returnArrays' statement='SELECT * FROM foo LIMIT 1' tableSeedSize=100000 n=100000             ***             -1.29 %   ±0.68%  ±0.91%  ±1.19%
sqlite/sqlite-prepare-select-all-options.js options='none' statement='SELECT * FROM foo LIMIT 100' tableSeedSize=100000 n=100000                               ***             -2.47 %   ±0.40%  ±0.53%  ±0.71%
sqlite/sqlite-prepare-select-all-options.js options='readBigInts' statement='SELECT * FROM foo LIMIT 100' tableSeedSize=100000 n=100000                        ***             -1.80 %   ±0.73%  ±0.98%  ±1.27%
sqlite/sqlite-prepare-select-all-options.js options='returnArrays' statement='SELECT * FROM foo LIMIT 100' tableSeedSize=100000 n=100000                         *             -0.87 %   ±0.82%  ±1.08%  ±1.41%
sqlite/sqlite-prepare-select-all-options.js options='readBigInts|returnArrays' statement='SELECT * FROM foo LIMIT 100' tableSeedSize=100000 n=100000                           -0.09 %   ±0.74%  ±0.99%  ±1.29%
sqlite/sqlite-prepare-select-all.js statement='SELECT 1' tableSeedSize=100000 n=100000                                                                         ***             -3.93 %   ±1.41%  ±1.88%  ±2.45%
sqlite/sqlite-prepare-select-all.js statement='SELECT * FROM foo LIMIT 1' tableSeedSize=100000 n=100000                                                        ***             -2.49 %   ±0.71%  ±0.95%  ±1.24%
sqlite/sqlite-prepare-select-all.js statement='SELECT * FROM foo LIMIT 100' tableSeedSize=100000 n=100000                                                      ***             -2.81 %   ±0.42%  ±0.56%  ±0.75%
sqlite/sqlite-prepare-select-all.js statement='SELECT text_column FROM foo LIMIT 1' tableSeedSize=100000 n=100000                                                              +0.05 %   ±1.15%  ±1.55%  ±2.04%
sqlite/sqlite-prepare-select-all.js statement='SELECT text_column FROM foo LIMIT 100' tableSeedSize=100000 n=100000                                            ***            -15.69 %   ±0.26%  ±0.34%  ±0.46%
sqlite/sqlite-prepare-select-all.js statement='SELECT text_column, integer_column FROM foo LIMIT 1' tableSeedSize=100000 n=100000                              ***             -1.48 %   ±0.78%  ±1.04%  ±1.38%
sqlite/sqlite-prepare-select-all.js statement='SELECT text_column, integer_column FROM foo LIMIT 100' tableSeedSize=100000 n=100000                            ***            -15.68 %   ±0.34%  ±0.45%  ±0.60%
sqlite/sqlite-prepare-select-all.js statement='SELECT text_column, integer_column, real_column FROM foo LIMIT 1' tableSeedSize=100000 n=100000                 ***             -5.18 %   ±0.94%  ±1.26%  ±1.67%
sqlite/sqlite-prepare-select-all.js statement='SELECT text_column, integer_column, real_column FROM foo LIMIT 100' tableSeedSize=100000 n=100000               ***            -16.99 %   ±0.34%  ±0.45%  ±0.59%
sqlite/sqlite-prepare-select-all.js statement='SELECT text_column, integer_column, real_column, blob_column FROM foo LIMIT 1' tableSeedSize=100000 n=100000    ***             -2.18 %   ±0.75%  ±1.00%  ±1.30%
sqlite/sqlite-prepare-select-all.js statement='SELECT text_column, integer_column, real_column, blob_column FROM foo LIMIT 100' tableSeedSize=100000 n=100000  ***             -2.96 %   ±0.58%  ±0.77%  ±1.00%
sqlite/sqlite-prepare-select-all.js statement='SELECT text_8kb_column FROM foo_large LIMIT 1' tableSeedSize=100000 n=100000                                                    -0.35 %   ±2.33%  ±3.11%  ±4.04%
sqlite/sqlite-prepare-select-all.js statement='SELECT text_8kb_column FROM foo_large LIMIT 100' tableSeedSize=100000 n=100000                                  ***             -0.52 %   ±0.28%  ±0.38%  ±0.50%

                                                                                                                                                                  -17.3%             0%             +17.3%
sqlite/sqlite-prepare-select-all-options.js options='none' statement='SELECT * FROM foo LIMIT 1' tableSeedSize=100000 n=100000                                                 ░███|                     -2.37% ***
sqlite/sqlite-prepare-select-all-options.js options='readBigInts' statement='SELECT * FROM foo LIMIT 1' tableSeedSize=100000 n=100000                                           ░██|                     -1.82% ***
sqlite/sqlite-prepare-select-all-options.js options='returnArrays' statement='SELECT * FROM foo LIMIT 1' tableSeedSize=100000 n=100000                                          ░██|                     -1.74% ***
sqlite/sqlite-prepare-select-all-options.js options='readBigInts|returnArrays' statement='SELECT * FROM foo LIMIT 1' tableSeedSize=100000 n=100000                               ░█|                     -1.29% ***
sqlite/sqlite-prepare-select-all-options.js options='none' statement='SELECT * FROM foo LIMIT 100' tableSeedSize=100000 n=100000                                                ███|                     -2.47% ***
sqlite/sqlite-prepare-select-all-options.js options='readBigInts' statement='SELECT * FROM foo LIMIT 100' tableSeedSize=100000 n=100000                                         ░██|                     -1.80% ***
sqlite/sqlite-prepare-select-all-options.js options='returnArrays' statement='SELECT * FROM foo LIMIT 100' tableSeedSize=100000 n=100000                                         ░█|                     -0.87% *
sqlite/sqlite-prepare-select-all-options.js options='readBigInts|returnArrays' statement='SELECT * FROM foo LIMIT 100' tableSeedSize=100000 n=100000                              ░|                     -0.09% 
sqlite/sqlite-prepare-select-all.js statement='SELECT 1' tableSeedSize=100000 n=100000                                                                                       ░█████|                     -3.93% ***
sqlite/sqlite-prepare-select-all.js statement='SELECT * FROM foo LIMIT 1' tableSeedSize=100000 n=100000                                                                        ░███|                     -2.49% ***
sqlite/sqlite-prepare-select-all.js statement='SELECT * FROM foo LIMIT 100' tableSeedSize=100000 n=100000                                                                      ░███|                     -2.81% ***
sqlite/sqlite-prepare-select-all.js statement='SELECT text_column FROM foo LIMIT 1' tableSeedSize=100000 n=100000                                                                 ░|                     +0.05% 
sqlite/sqlite-prepare-select-all.js statement='SELECT text_column FROM foo LIMIT 100' tableSeedSize=100000 n=100000                                              ██████████████████|                     -15.69% ***
sqlite/sqlite-prepare-select-all.js statement='SELECT text_column, integer_column FROM foo LIMIT 1' tableSeedSize=100000 n=100000                                               ░██|                     -1.48% ***
sqlite/sqlite-prepare-select-all.js statement='SELECT text_column, integer_column FROM foo LIMIT 100' tableSeedSize=100000 n=100000                              ██████████████████|                     -15.68% ***
sqlite/sqlite-prepare-select-all.js statement='SELECT text_column, integer_column, real_column FROM foo LIMIT 1' tableSeedSize=100000 n=100000                              ░██████|                     -5.18% ***
sqlite/sqlite-prepare-select-all.js statement='SELECT text_column, integer_column, real_column FROM foo LIMIT 100' tableSeedSize=100000 n=100000               ████████████████████|                     -16.99% ***
sqlite/sqlite-prepare-select-all.js statement='SELECT text_column, integer_column, real_column, blob_column FROM foo LIMIT 1' tableSeedSize=100000 n=100000                     ███|                     -2.18% ***
sqlite/sqlite-prepare-select-all.js statement='SELECT text_column, integer_column, real_column, blob_column FROM foo LIMIT 100' tableSeedSize=100000 n=100000                  ░███|                     -2.96% ***
sqlite/sqlite-prepare-select-all.js statement='SELECT text_8kb_column FROM foo_large LIMIT 1' tableSeedSize=100000 n=100000                                                     ░░░|░                    -0.35% 
sqlite/sqlite-prepare-select-all.js statement='SELECT text_8kb_column FROM foo_large LIMIT 100' tableSeedSize=100000 n=100000                                                     █|                     -0.52% ***

Rates were scaled by 1000x into HdrHistogram (3 significant figures).
Use --scale to adjust precision if needed.

Be aware that when doing many comparisons the risk of a false-positive
result increases. In this case, there are 21 comparisons, you can thus
expect the following amount of false-positive results:
  1.05 false positives, when considering a   5% risk acceptance (*, **, ***),
  0.21 false positives, when considering a   1% risk acceptance (**, ***),
  0.02 false positives, when considering a 0.1% risk acceptance (***)

The stars above are per-benchmark and uncorrected. Adjusting for the size of
this comparison set (Holm-Bonferroni), 17 comparisons remain significant at 5%.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

trivikr
trivikr approved these changes Oct 13, 2026
View reviewed changes
@trivikr trivikr added request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. author ready PRs with CI started, the required approvals, and no outstanding review comments. labels Oct 13, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Oct 13, 2026
@nodejs-github-bot

nodejs-github-bot commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/78351/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mcollina
mcollina approved these changes Oct 13, 2026
View reviewed changes

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@araujogui araujogui added the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Oct 13, 2026
@github-actions github-actions Bot removed the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Oct 13, 2026
@nodejs-github-bot

nodejs-github-bot commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/78377/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@araujogui araujogui added the commit-queue PRs queued for automated landing through the Commit Queue. label Oct 14, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 68df1db into nodejs:main Oct 14, 2026
106 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

Landed in 68df1db

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Oct 14, 2026
@aduh95 aduh95 mentioned this pull request Oct 27, 2026
2026-10-28, Version 27.0.0-alpha.0.0.0 (Alpha) #67062
Merged
aduh95 pushed a commit that referenced this pull request Nov 12, 2026
@araujogui @aduh95
sqlite: use shared-shape objects for result rows
8da7c4f
`all()`, `get()` and `iterate()` built each row with the
`Object::New()` overload that takes names and values. That overload
always returns a dictionary-mode object, so no two rows shared a map
and every property read was a hash lookup.

Build rows from a `DictionaryTemplate` cached on the statement in place
of the column names, invalidated on re-prepare. Rows keep their null
prototype. Statements whose column names a template cannot express
(array indices, duplicates, non-ASCII names, which the template
interns as Latin-1) or with more than 64 columns keep the previous
path.

Add a benchmark that reads every column of each row, since the
existing ones only measure building rows.

Fixes: #65799
Assisted-by: Claude
Signed-off-by: Guilherme Araújo <[email protected]>
PR-URL: #66385
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
@github-actions github-actions Bot mentioned this pull request Nov 20, 2026
2026-11-30, Version 26.14.0 'Lithium' (LTS) #67664
Open
gabylb pushed a commit to gabylb/node that referenced this pull request Nov 27, 2026
@araujogui @gabylb
sqlite: use shared-shape objects for result rows
0aeda4e
`all()`, `get()` and `iterate()` built each row with the
`Object::New()` overload that takes names and values. That overload
always returns a dictionary-mode object, so no two rows shared a map
and every property read was a hash lookup.

Build rows from a `DictionaryTemplate` cached on the statement in place
of the column names, invalidated on re-prepare. Rows keep their null
prototype. Statements whose column names a template cannot express
(array indices, duplicates, non-ASCII names, which the template
interns as Latin-1) or with more than 64 columns keep the previous
path.

Add a benchmark that reads every column of each row, since the
existing ones only measure building rows.

Fixes: nodejs#65799
Assisted-by: Claude
Signed-off-by: Guilherme Araújo <[email protected]>
PR-URL: nodejs#66385
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@mcollina mcollina mcollina approved these changes
@trivikr trivikr trivikr approved these changes
@jasnell jasnell Awaiting requested review from jasnell
@joyeecheung joyeecheung Awaiting requested review from joyeecheung

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. c++ Issues and PRs that require attention from people who are familiar with C++. needs-benchmark-ci PRs 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

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

sqlite: remove the null prototype from result rows

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@araujogui @nodejs-github-bot @trivikr @mcollina
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.