• <bdo id='MVYKb'></bdo><ul id='MVYKb'></ul>
  1. <small id='MVYKb'></small><noframes id='MVYKb'>

  2. <i id='MVYKb'><tr id='MVYKb'><dt id='MVYKb'><q id='MVYKb'><span id='MVYKb'><b id='MVYKb'><form id='MVYKb'><ins id='MVYKb'></ins><ul id='MVYKb'></ul><sub id='MVYKb'></sub></form><legend id='MVYKb'></legend><bdo id='MVYKb'><pre id='MVYKb'><center id='MVYKb'></center></pre></bdo></b><th id='MVYKb'></th></span></q></dt></tr></i><div id='MVYKb'><tfoot id='MVYKb'></tfoot><dl id='MVYKb'><fieldset id='MVYKb'></fieldset></dl></div>

    1. <tfoot id='MVYKb'></tfoot>
      <legend id='MVYKb'><style id='MVYKb'><dir id='MVYKb'><q id='MVYKb'></q></dir></style></legend>

      对于 Array,使用 map() &amp; 是否更有效?在java

      时间:2023-09-07
        <tbody id='5lmRj'></tbody>

        <small id='5lmRj'></small><noframes id='5lmRj'>

              • <bdo id='5lmRj'></bdo><ul id='5lmRj'></ul>
                <tfoot id='5lmRj'></tfoot><legend id='5lmRj'><style id='5lmRj'><dir id='5lmRj'><q id='5lmRj'></q></dir></style></legend>
              • <i id='5lmRj'><tr id='5lmRj'><dt id='5lmRj'><q id='5lmRj'><span id='5lmRj'><b id='5lmRj'><form id='5lmRj'><ins id='5lmRj'></ins><ul id='5lmRj'></ul><sub id='5lmRj'></sub></form><legend id='5lmRj'></legend><bdo id='5lmRj'><pre id='5lmRj'><center id='5lmRj'></center></pre></bdo></b><th id='5lmRj'></th></span></q></dt></tr></i><div id='5lmRj'><tfoot id='5lmRj'></tfoot><dl id='5lmRj'><fieldset id='5lmRj'></fieldset></dl></div>
                本文介绍了对于 Array,使用 map() &amp; 是否更有效?在javascript中减少()而不是forEach()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                1)我们知道,map() 和reduce() 没有副作用.如今,我们在手机上也有多核.那么使用它们是否更有效?

                1)As we know, there's no side-effect with map() and reduce(). Nowadays, we also have muti-core on cell phone. So is it more efficient to use them?

                2)另一方面,在大多数浏览器上只有一个 js 线程可以执行.所以map()和reduce()是为服务端脚本准备的?

                2)On the other hand, there's only 1 thread for js to execute on most of the browsers. Therefor map() and reduce() are prepared for server-side scripting?

                推荐答案

                这很容易被忽视,但获得 MapReduce 好处的关键在于

                It is easily overlooked, but the key to getting the benefits of MapReduce is to

                A) 利用优化的随机播放.通常,您的 map 和 reduce 函数可以用慢速语言实现,只要 shuffle(最昂贵的操作)得到很好的优化,它仍然是快速且可扩展的.

                A) Exploit the optimized shuffle. Often, your map and reduce functions can be implemented in a slow language, as long as the shuffle - the most expensive operation - is well optimized, it will still be fast and scalable.

                B) 利用检查点功能从节点故障中恢复(但希望您的 CPU 内核不会出现故障).

                B) Exploit the checkpointing functionality to recover from node failures (but hopefully, your CPU cores won't fail).

                所以说到底,map-reduce 实际上既不是 map,也不是 reduce 函数.这是关于它周围的框架;即使使用糟糕的map"和reduce"功能,它也会为您提供良好的性能(除非您在 shuffle 步骤中失去对数据集大小的控制!).

                So in the end, map-reduce is actually neither about the map, nor the reduce functions. It's about the framework around it; which will give you good performance even with bad "map" and "reduce" functions (unless you lose control over your data set size in the shuffle step!).

                在单个节点上执行多线程 map-reduce 所获得的收益相当低,并且很可能有 比 map-reduce 更好的方法来为共享内存架构并行化您的商店...

                The gains to be obtained from doing a multi-threaded map-reduce on a single node are fairly low, and most likely there are much better ways of parallelizing your shop for shared memory architectures than map-reduce...

                不幸的是,现在围绕 mapreduce 有很多炒作(而且理解太少).如果您查找 原始论文,它会详细介绍备份任务"、机器故障"和局部优化"(对于内存中的单主机用例,这两者都没有意义).

                Unfortunately, there is a lot of hype (and too little understanding) surrounding mapreduce these days. If you look up the original paper, it goes into detail about "Backup Tasks", "Machine Failures" and "locality optimization" (neither of which makes sense for an in-memory single-host use case).

                仅仅因为它有一个map"和一个reduce"并不能使它成为一个mapreduce".
                如果它具有优化的随机播放、节点崩溃和落后者恢复,则它只是一个 MapReduce.

                Just because it has a "map" and a "reduce" doesn't make it a "mapreduce" yet.
                It's only a MapReduce if it has an optimized shuffle, node crash and straggler recovery.

                这篇关于对于 Array,使用 map() &amp; 是否更有效?在javascript中减少()而不是forEach()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                <legend id='ibynt'><style id='ibynt'><dir id='ibynt'><q id='ibynt'></q></dir></style></legend>

                  • <bdo id='ibynt'></bdo><ul id='ibynt'></ul>
                    1. <tfoot id='ibynt'></tfoot>
                        <tbody id='ibynt'></tbody>

                      1. <i id='ibynt'><tr id='ibynt'><dt id='ibynt'><q id='ibynt'><span id='ibynt'><b id='ibynt'><form id='ibynt'><ins id='ibynt'></ins><ul id='ibynt'></ul><sub id='ibynt'></sub></form><legend id='ibynt'></legend><bdo id='ibynt'><pre id='ibynt'><center id='ibynt'></center></pre></bdo></b><th id='ibynt'></th></span></q></dt></tr></i><div id='ibynt'><tfoot id='ibynt'></tfoot><dl id='ibynt'><fieldset id='ibynt'></fieldset></dl></div>

                        <small id='ibynt'></small><noframes id='ibynt'>