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 — http2: copy small DATA chunks out of socket reads by ShogunPanda · Pull Request #67640 · nodejs/node

Conversation

@ShogunPanda

@ShogunPanda ShogunPanda commented Nov 20, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

A DATA chunk handed to JavaScript was always a slice of the ArrayBuffer holding the whole socket read. A small chunk queued in a paused stream therefore kept every other byte of that read alive (other frames, padding, ...).

This copies a chunk into a right-sized backing store when the socket read is more than four times larger than the chunk, and keeps slicing it otherwise. With the default limits, full-size DATA frames in a full socket read are still sliced, so bulk transfers keep avoiding the copy.

The new test sends one-byte DATA frames, each sharing a socket read with a large ignored extension frame, leaves the request body unconsumed and checks that every queued chunk is backed by a small ArrayBuffer.

Sorry, something went wrong.

Uh oh!

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

All reactions
@nodejs-github-bot

nodejs-github-bot commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/http2
  • @nodejs/net
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 c++ Issues and PRs that require attention from people who are familiar with C++. http2 Issues and PRs related to the http2 subsystem. needs-ci PRs that need a full CI run. labels Nov 20, 2026
@codecov

codecov Bot commented Nov 20, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.73%. Comparing base (50ba1ec) to head (8a32586).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/node_http2.cc 81.81% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67640      +/-   ##
==========================================
+ Coverage   90.71%   90.73%   +0.01%     
==========================================
  Files         801      801              
  Lines      280906   280914       +8     
  Branches    54246    54249       +3     
==========================================
+ Hits       254834   254890      +56     
+ Misses      16251    16195      -56     
- Partials     9821     9829       +8     
Files with missing lines Coverage Δ
src/node_http2.cc 82.25% <81.81%> (+0.14%) ⬆️

... and 38 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 requested review from jasnell and pimterry November 20, 2026 11:00
@mcollina

mcollina commented Nov 20, 2026

Copy link
Copy Markdown
Member

Can you run a benchmark?

All reactions

Sorry, something went wrong.

Uh oh!

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

@ShogunPanda
http2: copy small DATA chunks out of socket reads
8a32586
A DATA chunk handed to JavaScript was always a slice of the ArrayBuffer
holding the whole socket read. A small chunk queued in a paused stream
therefore kept alive every other byte of that read, such as other
frames or padding.

Copy a chunk into a right-sized backing store when the socket read is
more than four times larger than the chunk, and keep slicing it
otherwise, so full-size DATA frames in a full read still avoid the
copy.

Assisted-By: OpenAI GPT-5.6 Sol <openai/gpt-5.6-sol>
Signed-off-by: Paolo Insogna <[email protected]>
@ShogunPanda
ShogunPanda force-pushed the http2-copy-small-data-chunks branch from 3c2177e to 8a32586 Compare November 20, 2026 11:20
@lpinca

lpinca commented Nov 20, 2026

Copy link
Copy Markdown
Member

See also #67327.

All reactions

Sorry, something went wrong.

Uh oh!

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

@Ethan-Arrowood Ethan-Arrowood mentioned this pull request Nov 24, 2026
nodejs-review-bank: defer PRs that are waiting on their author Ethan-Arrowood/agentic#32
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@pimterry pimterry Awaiting requested review from pimterry
@jasnell jasnell Awaiting requested review from jasnell

At least 1 approving review is required to merge this pull request.

Uh oh!

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

Assignees

No one assigned

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. http2 Issues and PRs related to the http2 subsystem. needs-ci PRs that need a full CI run.

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

@ShogunPanda @nodejs-github-bot @mcollina @lpinca
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.