Title: sqlite: remove the null prototype from result rows · Issue #65799 · nodejs/node · GitHub
Open Graph Title: sqlite: remove the null prototype from result rows · Issue #65799 · nodejs/node
X Title: sqlite: remove the null prototype from result rows · Issue #65799 · nodejs/node
Description: Current behavior Rows returned by get(), all() and iterate() are created with a null prototype. The V8 API that does this produces dictionary-mode objects, and V8 will not cache a prototype transition on a dictionary map, so every row al...
Open Graph Description: Current behavior Rows returned by get(), all() and iterate() are created with a null prototype. The V8 API that does this produces dictionary-mode objects, and V8 will not cache a prototype transit...
X Description: Current behavior Rows returned by get(), all() and iterate() are created with a null prototype. The V8 API that does this produces dictionary-mode objects, and V8 will not cache a prototype transit...
Opengraph URL: https://github.com/nodejs/node/issues/65799
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"sqlite: remove the null prototype from result rows","articleBody":"**Current behavior**\n\nRows returned by `get()`, `all()` and `iterate()` are created with a `null` prototype. The V8 API that does this produces dictionary-mode objects, and V8 will not cache a prototype transition on a dictionary map, so every row also gets its own freshly allocated hidden class. Rows from the same statement therefore share no shape: they are slow to build, and every property access on them in user code is megamorphic.\n\n**Proposal**\n\nDrop the null prototype and build rows with `v8::DictionaryTemplate`, cached per statement. Rows become ordinary objects, and every row of a statement shares one hidden class.\n\n**Pros**\n\n- `all()` is 10–37% faster depending on the query; reading the rows afterwards is far cheaper still.\n- Consistent with `run()`, which already returns an ordinary object, and with `better-sqlite3`.\n\n**Cons**\n\n- Semver-major.\n- Rows can no longer be indexed by untrusted keys without `Object.hasOwn()` — `row.toString` and `row.constructor` start resolving through `Object.prototype`.\n- User code comparing rows against `{ __proto__: null, ... }` breaks.\n\nPrototype pollution is not a concern either way: rows are built by defining own properties directly, so a `__proto__` column is an own property and never reaches `Object.prototype`.\n\nI have benchmarks and a working implementation if there is interest.\n","author":{"url":"https://github.com/araujogui","@type":"Person","name":"araujogui"},"datePublished":"2026-09-04T17:45:47Z","url":"https://github.com/nodejs/node/issues/65799"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8541046c-4ee2-6cdd-f052-dc58444178a3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DA5E:9EF81:73096F:959653:6AED3131 |
| html-safe-nonce | 8a532b6f3b5c92a33ecee1b87d0922adab08e5f4bab473dcd06a950fb80e86d6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTVFOjlFRjgxOjczMDk2Rjo5NTk2NTM6NkFFRDMxMzEiLCJ2aXNpdG9yX2lkIjoiOTAzMDkxMzQ0MTcxODQxNTY2NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5f6fec3843b3e7eaff34f23a127ab97ac70dfc12262798dc03590416f9acd6cf |
| hovercard-subject-tag | issue:5351269540 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/65799/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9f35d070c64ce103bdfdfb1f7b15b6493e82ff6d6d95716eae293ef83d1fe199/nodejs/node/issues/65799 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9f35d070c64ce103bdfdfb1f7b15b6493e82ff6d6d95716eae293ef83d1fe199/nodejs/node/issues/65799 |
| og:image:alt | Current behavior Rows returned by get(), all() and iterate() are created with a null prototype. The V8 API that does this produces dictionary-mode objects, and V8 will not cache a prototype transit... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | araujogui |
| hostname | github.com |
| expected-hostname | github.com |
| None | e51d0b7b5ab34b1688c05b54c3ed17b8658b2fa9bca973a9c740683ccb12cf4a |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 59ebb7b901cc154ecc179a44f266fcf69f343b30 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width