---
title: "Node.js: node:sqlite query performance in C++ | VulCode"
description: "A fix in Node.js in C++: node:sqlite no longer clears every parameter before each statement run, so SQLite 3.54 re-prepares statements less often."
url: "https://vulcode.com/en/opensource/contributions/nodejs"
lang: "en"
---

[All contributions](https://vulcode.com/en/opensource/contributions)

nodejs/node

# Node.js

The JavaScript runtime built on V8 that runs servers, command line tools and front-end build pipelines. It ships a built-in node:sqlite module for working with SQLite databases.

[See the repository](https://github.com/nodejs/node) [All contributions](https://vulcode.com/en/opensource/contributions)

- **Language**: JavaScript
- **GitHub stars**: 123,955
- **Merged changes**: 1
- **Project site**: [nodejs.org](https://nodejs.org)

## What we changed

We removed the sqlite3_clear_bindings() call that node:sqlite made before every statement run, which in SQLite 3.54 forced JOIN queries to be re-prepared. Omitted parameters still get NULL.

### What this work shows

- C++ bindings in Node.js

- The SQLite C API and query plans

- Query performance measurement

- Tests with node:test

What was broken

### JOIN queries re-prepared on every call

BindParams() called sqlite3_clear_bindings() before every statement run. Since SQLite 3.54 this invalidates the query plan, so a JOIN query was re-prepared on every get() and ran slower than on older Node.js versions.

How we fixed it

### NULL only for omitted parameters

BindParams() now tracks which parameters were bound and sets NULL only on the rest, and ResetAndBindStatement() does not clear at all, since it always binds every parameter. With BigInt parameters a get() went from 3.4-4.3 µs to about 0.7 µs.

[#66983](https://github.com/nodejs/node/pull/66983)

## Merged change 1

- [#66983 sqlite: avoid sqlite3_clear_bindings() before every run Merged 26 October 2026](https://github.com/nodejs/node/pull/66983)

## What it taught us

A slow JavaScript query can have its cause as deep as a C++ binding and a behaviour change in SQLite, so you have to go down to that level and measure the effect. When we remove a shortcut such as clearing every parameter, we keep its guarantee: an omitted parameter is still NULL.

## Other projects we write code for

- [**Material UI** JavaScript · 99,391 stars A React component library that implements Google's Material Design: ready-made text fields, selects, buttons and other interface elements.](https://vulcode.com/en/opensource/contributions/material-ui)

- [**Autoprefixer** JavaScript · 22,197 stars A PostCSS plugin that adds browser prefixes to CSS based on Can I Use data, including the -ms-grid syntax for CSS Grid layouts.](https://vulcode.com/en/opensource/contributions/autoprefixer)

- [**compromise** JavaScript · 12,176 stars A natural language processing library in JavaScript: it splits text into sentences and words, tags parts of speech, conjugates verbs and inflects nouns, and reads dates through a plugin. It runs in the browser and in Node.js.](https://vulcode.com/en/opensource/contributions/compromise)

- [**Cinnamon** JavaScript · 5,668 stars A Linux desktop environment developed by the Linux Mint team, with a traditional panel and menu layout.](https://vulcode.com/en/opensource/contributions/cinnamon)

- [**spacetime** JavaScript · 4,104 stars A lightweight JavaScript library for working with dates and time zones.](https://vulcode.com/en/opensource/contributions/spacetime)

- [**fast-xml-parser** JavaScript · 3,143 stars A fast XML parser, validator and builder for JavaScript that works without C or C++ based libraries and without callbacks.](https://vulcode.com/en/opensource/contributions/fast-xml-parser)

## Describe your project.

A free quote comes back within an hour during working hours.

### Rather skip the form?

Ask in the chat or write to us directly.

Open the chat

- **Email**: [hello@vulcode.com](mailto:hello@vulcode.com)
- **Phone**: [+48 576 043 920](tel:+48576043920)
- **Discord**: [discord.gg/vulcode](https://discord.gg/vulcode)
