GeezerVison is showing github.com — src: skip the Environment lookup when it is already known by nigrosimone · Pull Request #67833 · nodejs/node
Conversation
nigrosimone
commented
Nov 27, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Follow-up of #66510, from the question in nodejs/performance#24 (comment) about places in Node that already have the Environment.
AsyncResource::MakeCallback() keeps env_, but went through InternalMakeCallback(isolate, ...), which looks up the Environment again from the creation context of the callback on every call. It now calls MakeCallbackInEnvironment(env_, ...), as Node-API does since node-api: find the Environment once #66509. This is the path of the addons that use node::AsyncResource.
Environment::CheckImmediate() called MakeCallback(env->isolate(), ...) with env in hand, now MakeCallback(env, ...).
The lookup removed is the same one #66510 saves for addons (133 -> 119 ns per call), so the AsyncResource row of benchmark/napi/make_callback should move the same way.
Disclosure: I used Opus 5.5 (Max) as coding assistant
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.52%. Comparing base (7ed1ca0) to head (8c5027b).
Additional details and impacted files
@@ Coverage Diff @@
## main #67833 +/- ##
==========================================
+ Coverage 90.51% 90.52% +0.01%
==========================================
Files 805 805
Lines 285878 285879 +1
Branches 55200 55199 -1
==========================================
+ Hits 258756 258786 +30
+ Misses 17214 17200 -14
+ Partials 9908 9893 -15
... and 29 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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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++.
needs-ci
PRs that need a full CI run.
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.
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.