-
Notifications
You must be signed in to change notification settings - Fork 31.3k
[WIP] node-api: optimize finalizer queue using container swap #57861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[WIP] node-api: optimize finalizer queue using container swap #57861
Conversation
Review requested:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #57861 +/- ##
========================================
Coverage 90.23% 90.24%
========================================
Files 630 630
Lines 185518 185935 +417
Branches 36369 36439 +70
========================================
+ Hits 167401 167789 +388
- Misses 11005 11009 +4
- Partials 7112 7137 +25
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assumption in the comment "userland code can delete additional references in one finalizer" will break with the new change.
However, this assumption was not reflected in test test/js-native-api/6_object_wrap/6_object_wrap.cc
. Would you mind updating the test to verify deleting another reference in the destructor of MyObject
?
MyObject::~MyObject() {
napi_delete_reference(env_, nested_);
napi_delete_reference(env_, wrapper_);
}
I updated, thanks |
tests passed in my local environment for macos but I think there is a problem in linux I will try |
I replaced the iterative per-item removal with a swap to reduce the overhead