4 ms·
My understanding is that mutating built in prototypes is very bad. Not just for interop reasons, but because doing so really hinders many optimizations javascri
by strbean 4y ago
My understanding is that mutating built in prototypes is very bad. Not just for interop reasons, but because doing so really hinders many optimizations javascript engines perform.
- cogman10 4y agoAdding methods to prototypes is effectively free. The only time mutating a builtin prototype has negative consequences is when you replace a builtin function with your own thing. All javascript engines (that I'm aware of) JIT at the method level so there's not really a performance impact modifying a prototype.
- strbean 4y agoAh, I think this is what I was thinking of: https://developer.mozilla.org/en-US/docs/Web/JavaScript/The_performance_hazards_of_prototype_mutation https://developer.mozilla.org/en-US/docs/Web/JavaScript/The_... It seems this only pertains specifically to overwriting the __proto__ of an existing object (the is the prototype of other things).