proposal-symbol-thenable
proposal-symbol-thenable copied to clipboard
Performance implications
It's been very complicated and tricky to optimize the performance of Promises in JavaScript engines. This proposal adds another Get to the Promise resolution path, which could degrade performance further. Is it worth that cost, when there are alternatives like special-casing Module Namespace objects? cc @gsathya
Keeping in mind poor perf is something that can generally be improved and ES6+ additions tend to have plenty of things to improve on that front... a single Get in an asynchronous operation is not likely to be a bottleneck.
Presumably it wouldn't be any less performant than the (potentially polluted) [[Get]] on .then itself? All of the same optimizations currently used to determine when Promise.prototype.then is present, unmodified, and unshadowed, could surely be used to ensure that Symbol.thenable was not present (or was set to true) on Promise.prototype as well?