-
Notifications
You must be signed in to change notification settings - Fork 27
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
[Question] why deleting value by object key is slow ? #4
Comments
AFAIK, JS uses hidden classes to optimize property lookup on objects with the same shape. Deleting a property makes the current hidden class invalid, so the VM has to use a much slower generic representation. |
@orangemi You may check out this article: https://github.com/petkaantonov/bluebird/wiki/Optimization-killers |
@ibigbug nice! |
reopening this issue because the linked article did not answer the question for me. Hmm, it just occured to me that I am using incrementing integers as keys. maybe this is handled as a special case and is not a hash table? I'll have to do another bench mark to test. |
highly related: https://mythbusters.js.org/#/v8-tips/freeing-memory |
You mentioned in README.md:
Do you have any tip about why deleting value by object key is slow ? I'm just curious about the reason.
The text was updated successfully, but these errors were encountered: