3 ms·
I think that almost everybody knows that barebones loops are faster than their functional alternatives, but that doesn't mean that they're typically the right c
by ralusek 8y ago
I think that almost everybody knows that barebones loops are faster than their functional alternatives, but that doesn't mean that they're typically the right choice.
On client side code, for the vast majority of web applications, performance issues are going to come from asynchronous remote requests or inefficient change detection/recompute/redraw calls. If there really is some computation that is performance critical and the 5-10x performance gain is actually noticeable (it doesn't matter if it's 1000x performance gain if it takes 50ms), then this might be a good place to start.
With nodejs, similarly, almost all performance issues are typically going to be related to the management of asynchronous calls, i.e. not doing things concurrently where possible, poorly optimized database calls, etc.
Suggesting that writing code using functional syntax is a "mistake that you should stop doing" fails to recognize that the code is far more concise and self-documenting, and 99.9% of the time is being executed in a span of time in which a 10x performance gain is beyond imperceptible.