Closed stonechoe closed 10 months ago
This PR should be to master
branch.
You are right, it's a performance optimization. Without this optimization, some methods worked unacceptably slow. However, now most methods where it's used are available in most engines, and Proxy
is enough popular. I will think make it sense to accept it or not.
Sorry for the confusion. I changed the base branch to master
.
Thank you for your hard work for maintaining this project. May I ask a question?
Does the "unacceptable slowness" come from the fact that Object.defineProperty(object, key, createPropertyDescriptor(0, value))
cannot be optimized by engine, whereas object[key] = value
can?
Or does it only occur when polyfill version is used for definePropertyModule.f
?
Does the "unacceptable slowness" come from the fact that
Object.defineProperty(object, key, createPropertyDescriptor(0, value))
cannot be optimized by engine, whereasobject[key] = value
can?
Yes. Some years ago it was dozens of times slower even in modern engines. I remember issues about optimizing this case in bug trackers of some engines. I didn't check the performance recently, so I don't know how it works in actual versions.
This PR is for https://github.com/zloirock/core-js/issues/1322
The changes are as follows
I am not certain about the impact of this patch on performance - in case the existing code was intentionally written for performance benefits like JIT optimization, please handle it appropriately at your discretion.