GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — src: give small stream reads their own buffer by orgads · Pull Request #67327 · nodejs/node Conversation
Contributor
Summary
EmitToJSStreamListener::OnStreamAlloc(suggested_size) + if suggested_size < StreamReadSlab::kSlabSize + return env->allocate_managed_buffer(suggested_size) // as before the slab return env->stream_read_slab().Allocate(isolate, suggested_size) Large reads (plain TCP) still use the slab. TLS already How this shows up in an application: we run a voice server with TTS audio over HTTPS. The audio arrives faster than real time and waits in JS queues for seconds. The chunks survive scavenges, so their slabs are promoted, and each pins 64KB of external memory. ArrayBuffer memory grew ~57MB between major GCs, and ~80% of major GCs started with Evidence
Merge DangerDoor: two-way. It changes only which allocator a read uses, so a revert restores the slab path. Blast Radius: stream reads.
🤖 Generated with Claude Code
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
orgads
force-pushed
the
stream-slab-small-reads
branch
from
3b8f3af to
9fa96cc
Compare
lpinca
reviewed
Uh oh!
There was an error while loading. Please reload this page. Every read was carved out of the env-wide 64KB StreamReadSlab and handed to JS as a view over it. TLS asks for exactly the decrypted size, so the copy-on-waste path in Commit() never triggers, and any TLS chunk that JS keeps pins the whole slab and every other read in it. Chunks queued for seconds (e.g. audio streamed faster than real time) get the slabs promoted, and their external memory then drives most major GCs. Reads asking for less than a slab now get a right-sized managed buffer, as before the slab existed. Large reads (plain TCP, where libuv suggests 64KB) still use the slab. Assisted-by: Claude Code Signed-off-by: Orgad Shaneh <[email protected]>
orgads
force-pushed
the
stream-slab-small-reads
branch
from
c1abe65 to
724c69a
Compare
lpinca
approved these changes
|
There was an error while loading. Please reload this page.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@ ## main #67327 +/- ## ======================================= Coverage 90.68% 90.68% ======================================= Files 797 797 Lines 279574 279577 +3 Branches 53778 53784 +6 ======================================= + Hits 253525 253544 +19 + Misses 16344 16306 -38 - Partials 9705 9727 +22
🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
ping? Do we need more approvers? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Landed in 6368e00 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thank you! Can this be backported to 26? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Yes, it will be backported. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Every read was carved out of the env-wide 64KB StreamReadSlab and handed to JS as a view over it. TLS asks for exactly the decrypted size, so the copy-on-waste path in Commit() never triggers, and any TLS chunk that JS keeps pins the whole slab and every other read in it. Chunks queued for seconds (e.g. audio streamed faster than real time) get the slabs promoted, and their external memory then drives most major GCs. Reads asking for less than a slab now get a right-sized managed buffer, as before the slab existed. Large reads (plain TCP, where libuv suggests 64KB) still use the slab. Assisted-by: Claude Code Signed-off-by: Orgad Shaneh <[email protected]> PR-URL: #67327 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
Every read was carved out of the env-wide 64KB StreamReadSlab and handed to JS as a view over it. TLS asks for exactly the decrypted size, so the copy-on-waste path in Commit() never triggers, and any TLS chunk that JS keeps pins the whole slab and every other read in it. Chunks queued for seconds (e.g. audio streamed faster than real time) get the slabs promoted, and their external memory then drives most major GCs. Reads asking for less than a slab now get a right-sized managed buffer, as before the slab existed. Large reads (plain TCP, where libuv suggests 64KB) still use the slab. Assisted-by: Claude Code Signed-off-by: Orgad Shaneh <[email protected]> PR-URL: nodejs#67327 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.