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
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. sqlite Issues and PRs related to the SQLite subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants