Keep onData, onDataV2 and onWritable callbacks in MoveOnlyFunction inline storage - #1325
Open
nigrosimone wants to merge 1 commit into
Open
nigrosimone wants to merge 1 commit into
nigrosimone wants to merge 1 commit into
Conversation
nigrosimone
marked this pull request as ready for review
September 19, 2026 05:10
This was referenced Sep 19, 2026
Author
|
Measured with the benchmark workflow proposed in #1326: this branch against master, both built on the same hosted runner, the load alternating between them (nigrosimone#2). Every row stays inside the noise band of the run, so at this resolution the change moves nothing in either direction, which is expected: one allocation per registration is well under a percent of a request.
"Noise" is how far base against base and head against head, the same code on both sides, got from 1.0 in the same run; a row is marked only when it moved more than that. Node v26.9.0, AMD EPYC 7763, 4 cores, wrk -t2 -c100. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
First part of #1300, only the NoexceptPersistent change.
v8::Globalhas a move constructor that is notnoexcept, so every lambda that captures aUniquePersistentfails theis_small_object_vtest in MoveOnlyFunction and is heap allocated, even when the capture is only 16 bytes (the handle plus the isolate pointer). That is onenewand onedeleteperonData,onDataV2andonWritableregistration.The fix is a small wrapper that restores the
noexcepton the move (the underlying move is a pointer swap and cannot throw), used in those three sites.onAbortedandcollectBodycapture more than 16 bytes and are left as they are.Checked with a static_assert on
ofats::any_detail::is_small_object_vfor a lambda capturingUniquePersistent(false) andNoexceptPersistent(true), compiled with MSVC against the Node 26 headers.