src: cut small costs in node::MakeCallback - #66395
Open
nigrosimone wants to merge 1 commit into
Open
nigrosimone wants to merge 1 commit into
nigrosimone wants to merge 1 commit into
Conversation
Enter the Environment's context only when it is not already the entered and current one, set the async context frame only when it changes, pass the resource variant to push_async_context() by const reference, and grow and shrink the native resource stack with push_back() and pop_back() instead of resize(). Refs: nodejs/performance#24 Signed-off-by: Nigro Simone <nigro.simone@gmail.com>
nigrosimone
marked this pull request as ready for review
September 29, 2026 14:08
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #66395 +/- ##
==========================================
+ Coverage 90.35% 90.37% +0.02%
==========================================
Files 792 792
Lines 275500 275515 +15
Branches 52791 52808 +17
==========================================
+ Hits 248932 249003 +71
+ Misses 16992 16931 -61
- Partials 9576 9581 +5
🚀 New features to boost your workflow:
|
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.
After #66316, node::MakeCallback still does some work that the common case does not need:
Each one is 1-5 ns, together about 10-14 ns per call. type=Call does not use this code. benchmark/compare.js, 30 runs, Linux x64:
Refs: nodejs/performance#24
Disclosure: I used Opus 5.5 (Max) as coding assistant