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.
If we have to pass say
fillCacheandasBufferoptions 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()andnapi_get_named_property()with just onenapi_get_named_property()call and checking if the return value isnapi_ok.