r/javascript • u/bananajsjs • May 13 '18
[Performance] Lodash vs ES6 : map()
https://medium.com/@peterchang_82818/es6-lodash-native-javascript-nodejs-example-tutorial-map-function-functional-programming-performance-speed-69645e613049
0
Upvotes
3
u/voidvector May 13 '18
If you are going to micro-benchmark, you might as well add
for.forwould out-perform both in 90% of the real world scenarios due to all the compiler optimization available (e.g. loop unrolling, loop invariant code motion, memory fragmentation, garbage collection).Ref: https://en.wikipedia.org/wiki/Loop_optimization