-
Notifications
You must be signed in to change notification settings - Fork 34
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
Observation: Unnecessarily calling napi_set_last_error() #205
Comments
I realize that once we have engine-specific codes, two different |
#define MAYBE_SET_LAST_ERROR(status) \
((static_last_error.error_code == status) ? status : \
napi_set_last_error(status)) |
Wouldn't the call to |
Well, if we can be fairly certain that there won't be a function call, then we can certainly leave things as they are. |
My preference is to have it be inlined versus making and additional check. Since its internal to the implementation we can always change our mind if we find that it stands out as a problem in future performance measurements. |
Once #198 is fixed, |
/me is not too familiar with the conditions that make it impossible to inline things. |
I'm pretty sure |
Alrighty then. |
If we want to avoid function call overhead maybe we should put a macro around
napi_set_last_error()
which avoids calling it ifstatic_last_error.error_code
is already set to the code which it is instructed to set. I'm not sure if it's worth the overhead savings.The text was updated successfully, but these errors were encountered: