简体   繁体   English

为什么Lo-Dash _.each比Boiler.js _.each和Underscore.js _.each快?

[英]Why is Lo-Dash _.each faster than Boiler.js _.each and Underscore.js _.each?

Perf Test 性能测试

Having not yet had the time to review the Lo-Dash code base (in great detail - work has me pretty strapped for time) I was wondering if someone could explain to me off the top of their head how Lo-Dash's _.each method out performs other libraries equivalents? 还没有时间检查Lo-Dash代码库(非常详细-工作使我花了很多时间),我想知道是否有人可以向我解释一下Lo-Dash的_.each方法如何执行其他库的等效项?

Google is your friend, young grasshopper: http://kitcambridge.be/blog/say-hello-to-lo-dash/ Google是您的朋友,年轻的蚱hopper: http//kitcambridge.be/blog/say-hello-to-lo-dash/

In summary: Lo-Dash avoids using browser-native methods in favor of simple loops, which oddly enough are faster in most cases. 总结:Lo-Dash避免使用浏览器本机方法来支持简单循环,这奇怪的是在大多数情况下速度更快。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么Underscore.js chain()方法不是惰性的? - Why Underscore.js chain() method is not lazy? VBA:为什么 For Each 循环比 For 循环更快? - VBA: Why are For Each loops faster than For loops? for,foreach和iterator之间的比较:在这种情况下,为什么for快于for-each? - Comparison between for , foreach and iterator: Why the for is faster than for-each in this case? 为什么lodash.each比原生forEach更快? - Why is lodash.each faster than native forEach? PHP-为什么比较两个完整的长(相同)字符串要比比较每个字符串的第一个字符快? - PHP - Why is comparison of 2 entire long (identical) strings MUCH faster than comparison of the first character of each? 在某些情况下,为什么Ruby的Hash#值比Hash#each_value更快? - Why is Ruby's Hash#values faster than Hash#each_value in certain cases? Underscore.js性能问题-我可以使用_.defer - Underscore.js performance issue - Can i use _.defer 方法比带条件的迭代更快(每行的前任和后继) - Faster methods than iterrows with conditions (predecessor and successor of each row) bool数组上的Raw循环比transform或for_each快5倍 - Raw Loop on an array of bool is 5 times faster than transform or for_each 为什么#map 比#each 更有效? - Why is #map more efficient than #each?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM