__createBinding performance issue on web browsers
See original GitHub issue__createBinding
, which is used in __exportStar
, uses accessor descriptors to get exported modules. In our product, we see a 10x performance degradation referencing exported enums this way compared to using a direct access object. We’ve verified that by refactoring our enum exports to be explicitly defined and not *
, this issue is not seen.
Likewise, this issue is not seen in v1.14.0 when __createBinding
looks like
__createBinding = function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
};
current implementation:
__createBinding = Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
});
JSBench: https://jsbench.me/yokwmk1mau/1
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Troubleshoot Chrome Browser performance issues
Is Chrome running too slow or using too much memory? Here's how to troubleshoot Chrome Browser performance issues on Microsoft ® Windows ®...
Read more >How to Speed Up Chrome, Firefox & Other Browsers - Avast
Resetting your browser should improve its performance. Try a different browser. If none of the above solutions has fixed the problem — you've ......
Read more >View Binding - Android Developers
Use Jetpack Compose on Wear OS · Compose performance · Navigation · Buttons · Cards ... Web-based content ... Known issues · StackOverflow....
Read more >Slow performance, unexpected responses and ... - Solve CRM
Slow performance, unexpected responses and troubleshooting browser related issues. · Firefox open History > Clear recent history > choose “Time range to clear: ......
Read more >The Ultimate Guide to Fixing JavaScript Performance ...
Similarly, CSS requires 73KB but performance problems are rare unless ... browser tools to help assess your JavaScript performance issues.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Unfortunately, I don’t think TypeScript is going to be able to provide the info required to prove that we can make that optimization; if you’re doing
export * from "./otherFile"
in some file, it can’t know which of those bindings are mutable and which aren’t (and that can continue onward as it’s reexported). I think that this is about as fast as we’re going to be able to make it.This is correct, but for our use case the
*
import is for classes and enums which aren’t being mutated.