Skip to content

benchmark: complete the sqlite is-transaction fix - #65218

Open
geeksilva97 wants to merge 1 commit into
nodejs:mainfrom
geeksilva97:benchmark-sqlite-is-transaction
Open

benchmark: complete the sqlite is-transaction fix#65218
geeksilva97 wants to merge 1 commit into
nodejs:mainfrom
geeksilva97:benchmark-sqlite-is-transaction

Conversation

@geeksilva97

@geeksilva97 geeksilva97 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

This PR removes the Logical AND assignment. It was causing the benchmark to call the isTransaction only once when the getter was returning false.

With the deadCodeElimination being false, the right side never runs.

Before

$ ./node benchmark/sqlite/sqlite-is-transaction.js
sqlite/sqlite-is-transaction.js transaction="true" n=10000000: 64,634,434.23269218
sqlite/sqlite-is-transaction.js transaction="false" n=10000000: 871,137,051.6366488

After

$ ./node benchmark/sqlite/sqlite-is-transaction.js
sqlite/sqlite-is-transaction.js transaction="true" n=10000000: 64,021,357.52487029
sqlite/sqlite-is-transaction.js transaction="false" n=10000000: 66,274,377.580040805

Signed-off-by: geeksilva97 <edigleyssonsilva@gmail.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/performance

@nodejs-github-bot nodejs-github-bot added benchmark Issues and PRs related to the benchmark subsystem. sqlite Issues and PRs related to the SQLite subsystem. labels Aug 11, 2026
@geeksilva97
geeksilva97 requested review from H4ad and RafaelGSS August 11, 2026 18:07

@H4ad H4ad left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The initial idea was to assert this never returns invalid value due any optimization (such as fast apis)

But this works as well, thanks for the fix

@geeksilva97

Copy link
Copy Markdown
Contributor Author

The initial idea was to assert this never returns invalid value due any optimization (such as fast apis)

But this works as well, thanks for the fix

No prob. Btw, this is my first time changing benchmark stuff. Do we need CI for it?

@geeksilva97 geeksilva97 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Aug 11, 2026
@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Benchmark GHA (sqlite / sqlite-is-transaction): https://github.com/nodejs/node/actions/runs/31584406184

Results

[!WARNING]
Do not take GHA benchmark results as face value, always confirm them
using a dedicated machine, e.g. Jenkins CI.

Benchmark results:

                                                               confidence improvement accuracy (*)   (**)  (***)
sqlite/sqlite-is-transaction.js transaction='false' n=10000000                 0.06 %       ±2.36% ±3.11% ±3.99%
sqlite/sqlite-is-transaction.js transaction='true' n=10000000                 -0.62 %       ±2.38% ±3.13% ±4.02%

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

[!WARNING]
Do not take GHA benchmark results as face value, always confirm them
using a dedicated machine, e.g. Jenkins CI.

@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 12, 2026
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. benchmark Issues and PRs related to the benchmark subsystem. commit-queue Add this label to land a pull request using GitHub Actions. sqlite Issues and PRs related to the SQLite subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants