30 ms·
This is a good example of premature optimization.
by elka 9y ago
This is a good example of premature optimization.
- cprecioso 9y agoI think this is an example of _optimization_. An optimization that is easily applied as a transform for Babel, but that's just it. Whether it is premature or not, it would depend on if you apply it carelessly without knowing whether you need it, or if you apply it when you know you need. Right?
- elka 9y agoThe optimization is transforming all code that matches the pattern independent from whether the code is hot or not. The transformation comes with cognitive cost for the developer as it can turn correct code into incorrect code (sparse arrays). By enabling this one trades complexity for potential performance gains. This is how I understand premature.
- Volt 9y agoIs it an optimization when it makes things slower?