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 — buffer: use typed arrays for 64-bit BigInt accessors by gurgunday · Pull Request #67549 · nodejs/node

Conversation

@gurgunday

@gurgunday gurgunday commented Nov 17, 2026

Copy link
Copy Markdown
Member

readBig(U)Int64{LE,BE}() and writeBig(U)Int64{LE,BE}() assembled and split values with BigInt arithmetic, allocating intermediate BigInts on every call. Copy the bytes through BigInt64Array and BigUint64Array views over the existing 8-byte scratch buffer instead, as the double accessors already do

benchmark/buffers/buffer-read.js (30 runs):

type buffer=fast buffer=slow
BigInt64LE +224.26 % *** +226.77 % ***
BigInt64BE +224.66 % *** +222.00 % ***
BigUInt64LE +39.58 % *** +39.66 % ***
BigUInt64BE +39.31 % *** +39.69 % ***

The other types are within noise (−1.48 % to +1.88 %).

benchmark/buffers/buffer-write.js (30 runs):

type buffer=fast buffer=slow
BigInt64LE +74.00 % *** +76.36 % ***
BigInt64BE +74.64 % *** +73.65 % ***
BigUInt64LE +68.63 % *** +68.76 % ***
BigUInt64BE +68.04 % *** +68.28 % ***

Sorry, something went wrong.

Uh oh!

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

bricss and H4ad reacted with rocket emoji
All reactions
  • 🚀 2 reactions
@gurgunday
buffer: use typed arrays for 64-bit BigInt accessors
6d52376
readBig(U)Int64{LE,BE}() and writeBig(U)Int64{LE,BE}() assembled and
split values with BigInt arithmetic, allocating intermediate BigInts on
every call. Copy the bytes through BigInt64Array and BigUint64Array
views over the existing 8-byte scratch buffer instead, as the double
accessors already do.

Range and bounds checks are unchanged, and the value is masked with
`& -1n` before the store so non-BigInt values still throw the same
TypeError instead of being coerced by the typed array.

benchmark/buffers/buffer-read.js now uses the value it reads. The
loop discarded it, which let V8 remove side-effect-free reads
altogether.

Assisted-by: claude:opus-5.5
Signed-off-by: Gürgün Dayıoğlu <[email protected]>
@nodejs-github-bot

nodejs-github-bot commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/performance
All reactions

Sorry, something went wrong.

Uh oh!

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

@nodejs-github-bot nodejs-github-bot added buffer Issues and PRs related to the buffer subsystem. needs-ci PRs that need a full CI run. labels Nov 17, 2026
@gurgunday gurgunday added the performance Issues and PRs related to the performance of Node.js. label Nov 17, 2026
@codecov

codecov Bot commented Nov 17, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.68%. Comparing base (55da353) to head (6d52376).
⚠️ Report is 78 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67549      +/-   ##
==========================================
+ Coverage   90.66%   90.68%   +0.01%     
==========================================
  Files         799      800       +1     
  Lines      280245   280963     +718     
  Branches    54121    54287     +166     
==========================================
+ Hits       254097   254800     +703     
+ Misses      16277    16254      -23     
- Partials     9871     9909      +38     
Files with missing lines Coverage Δ
lib/internal/buffer.js 98.92% <100.00%> (-0.04%) ⬇️

... and 82 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.

mcollina
mcollina approved these changes Nov 17, 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
@gurgunday gurgunday 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 Nov 17, 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 Nov 17, 2026
@nodejs-github-bot

nodejs-github-bot commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@gurgunday gurgunday added the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Nov 18, 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 Nov 18, 2026
jasnell
jasnell approved these changes Nov 18, 2026
View reviewed changes
@jasnell jasnell added the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Nov 18, 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 Nov 18, 2026
@nodejs-github-bot

nodejs-github-bot commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@gurgunday gurgunday added the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 18, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 41918c1 into nodejs:main Nov 19, 2026
92 checks passed

Uh oh!

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

@nodejs-github-bot

nodejs-github-bot commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Landed in 41918c1

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 Nov 19, 2026
@snovader snovader mentioned this pull request Nov 19, 2026
Read TypeScript's 64-bit integers through a scratch DataView snovader/tafla#285
Merged
snovader added a commit to snovader/tafla that referenced this pull request Nov 19, 2026
@snovader
Read TypeScript's 64-bit integers through a scratch DataView (#285)
892a69c
readInt64() and readUint64() added a value's two 32-bit words as bigints,
which allocated a bigint for each. They now copy the bytes to a scratch
DataView and read the value from it, as readFloat64() does, and as
nodejs/node#67549 changed Buffer's accessors to.
aduh95 pushed a commit that referenced this pull request Nov 20, 2026
@gurgunday @aduh95
buffer: use typed arrays for 64-bit BigInt accessors
9c88e74
readBig(U)Int64{LE,BE}() and writeBig(U)Int64{LE,BE}() assembled and
split values with BigInt arithmetic, allocating intermediate BigInts on
every call. Copy the bytes through BigInt64Array and BigUint64Array
views over the existing 8-byte scratch buffer instead, as the double
accessors already do.

Range and bounds checks are unchanged, and the value is masked with
`& -1n` before the store so non-BigInt values still throw the same
TypeError instead of being coerced by the typed array.

benchmark/buffers/buffer-read.js now uses the value it reads. The
loop discarded it, which let V8 remove side-effect-free reads
altogether.

Assisted-by: claude:opus-5.5
Signed-off-by: Gürgün Dayıoğlu <[email protected]>
PR-URL: #67549
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@github-actions github-actions Bot mentioned this pull request Nov 24, 2026
2026-11-25, Version 27.0.0-alpha.0.2.0 (Alpha) #67757
Merged
gabylb pushed a commit to gabylb/node that referenced this pull request Nov 27, 2026
@gurgunday @gabylb
buffer: use typed arrays for 64-bit BigInt accessors
0aa972b
readBig(U)Int64{LE,BE}() and writeBig(U)Int64{LE,BE}() assembled and
split values with BigInt arithmetic, allocating intermediate BigInts on
every call. Copy the bytes through BigInt64Array and BigUint64Array
views over the existing 8-byte scratch buffer instead, as the double
accessors already do.

Range and bounds checks are unchanged, and the value is masked with
`& -1n` before the store so non-BigInt values still throw the same
TypeError instead of being coerced by the typed array.

benchmark/buffers/buffer-read.js now uses the value it reads. The
loop discarded it, which let V8 remove side-effect-free reads
altogether.

Assisted-by: claude:opus-5.5
Signed-off-by: Gürgün Dayıoğlu <[email protected]>
PR-URL: nodejs#67549
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@mcollina mcollina mcollina approved these changes
@jasnell jasnell jasnell approved these changes

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. buffer Issues and PRs related to the buffer subsystem. needs-ci PRs that need a full CI run. performance Issues and PRs related to the performance of Node.js.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

4 participants

@gurgunday @nodejs-github-bot @mcollina @jasnell
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.