Skip to content

Conversation

@kjvalencik
Copy link
Member

@kjvalencik kjvalencik commented Oct 28, 2021

Switching to raw::InheritedScope is the more significant improvement. The argv change is more minor.

tl;dr -- We were always creating handle scopes on function calls, but Node-API has already done it for us. It's only necessary to create a scope for execute_scoped and compute_scoped.

Node-API creates handle scopes as part of the environment. Creating an explicit scope is only necessary for `Context::compute_scoped` and `Context::execute_scoped`.
@kjvalencik kjvalencik requested a review from dherman October 28, 2021 16:19
Additionally, avoids initialization of allocated space
Copy link
Collaborator

@dherman dherman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! The TODO comment gave me one idea for a maintenance practice, see what you think.

}

/// Gets the number of arguments passed to the function.
// TODO: Remove this when `CallContext` is refactored to get call info upfront.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idea: would it be useful to label TODO comments with labels for the future trigger that will allow the action to be taken, e.g. TODO(remove-legacy)?

@kjvalencik kjvalencik merged commit e50964a into main Nov 12, 2021
@kjvalencik kjvalencik deleted the kv/easy-perf-wins branch November 12, 2021 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants