Skip to content
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

Avoid passing options objects to C++ #4

Open
vweevers opened this issue Feb 21, 2022 · 0 comments
Open

Avoid passing options objects to C++ #4

vweevers opened this issue Feb 21, 2022 · 0 comments
Labels
benchmark Requires or pertains to benchmarking

Comments

@vweevers
Copy link
Member

If we have to pass say fillCache and asBuffer options from JS to C++, it's faster to pass those as boolean arguments, rather than a { fillCache, asBuffer } object.

In cases where we can't replace use of options objects, we can still optimize that, by replacing napi_has_named_property() and napi_get_named_property() with just one napi_get_named_property() call and checking if the return value is napi_ok.

@vweevers vweevers added the benchmark Requires or pertains to benchmarking label Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmark Requires or pertains to benchmarking
Projects
Status: Todo
Development

No branches or pull requests

1 participant