-
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
Cache the Symbol.hasInstance value #209
Comments
4 tasks
This was suggested in the node/master PR comment: nodejs/node#11975 (comment) |
I can take this once #208 lands. |
gabrielschulhof
pushed a commit
to gabrielschulhof/abi-stable-node
that referenced
this issue
Mar 29, 2017
gabrielschulhof
pushed a commit
to gabrielschulhof/abi-stable-node
that referenced
this issue
Mar 30, 2017
gabrielschulhof
pushed a commit
to gabrielschulhof/abi-stable-node
that referenced
this issue
Mar 30, 2017
gabrielschulhof
pushed a commit
to gabrielschulhof/abi-stable-node
that referenced
this issue
Mar 30, 2017
gabrielschulhof
pushed a commit
to gabrielschulhof/abi-stable-node
that referenced
this issue
Mar 31, 2017
gabrielschulhof
pushed a commit
to gabrielschulhof/abi-stable-node
that referenced
this issue
Apr 3, 2017
gabrielschulhof
pushed a commit
to gabrielschulhof/abi-stable-node
that referenced
this issue
Apr 3, 2017
gabrielschulhof
pushed a commit
to gabrielschulhof/node
that referenced
this issue
Apr 5, 2017
This improves the performance of napi_instanceof() by retrieving Symbol.hasInstance from the global object once and then storing a persistent reference to it in the env. Re nodejs/abi-stable-node#209 Re nodejs/abi-stable-node#214
2 tasks
Closing as this has landed in master. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For the V8 implementation of
napi_instanceof
, we look up the value ofSymbol.hasInstance
, so that we can check if a particular constructor has customized theinstanceof
behavior.As an optimization, the
Symbol.hasInstance
value could be cached (for eachnapi_env
), which will save some extra work of looking it up for each call tonapi_instanceof
.The text was updated successfully, but these errors were encountered: