职场定律|阿姆达尔定律(Amdahl’s Law)

Gene Amdahl进行了一个富有洞察力的观察: 提升一个系统的一个部分的性能对整个系统有多大影响。这一观察被称为Amdahl’s Law(阿姆达尔定律):

(注:这里的系统,可指计算机系统或别的什么系统)

当提升系统的一部分性能时,对整个系统性能的影响取决于:1、这一部分有多重要 2、这一部分性能提升了多少

  阿姆达尔定律是一个计算机科学界的经验法则,因IBM公司计算机架构师吉恩·阿姆达尔而得名。

吉恩·阿姆达尔在1967年发表的论文中提出了这个重要定律。
阿姆达尔定律主要用于发现仅仅系统的部分得到改进,整体系统可以得到的最大期望改进。它经常用于并行计算领域,用来预测适用多个处理器时理论上的最大加速比。在我们的性能调优领域,我们利用此定律有助于我们解决或者缓解性能瓶颈问题。
阿姆达尔定律的模型阐释了我们现实生产中串行资源争用时候的现象。如下图模型,一个系统中,不可避免有一些资源必须串行访问,这限制了我们的加速比,即使我们增加了并发数(横轴),但取得效果并不理想,难以获得线性扩展能力(图中直线)。

Amdahl’s Law is a formula which shows the potential speedup of a computational task which can be achieved by increasing the resources of a system. Normally used in parallel computing, it can predict the actual benefit of increasing the number of processors, which is limited by the parallelisability of the program.

Best illustrated with an example. If a program is made up of two parts, part A, which must be executed by a single processor, and part B, which can be parallelised, then we see that adding multiple processors to the system executing the program can only have a limited benefit. It can potentially greatly improve the speed of part B – but the speed of part A will remain unchanged.

The diagram below shows some examples of potential improvements in speed:

(Image Reference: By Daniels219 at English Wikipedia, Creative Commons Attribution-Share Alike 3.0 Unported, https://en.wikipedia.org/wiki/File:AmdahlsLaw.svg)

As can be seen, even a program which is 50% parallelisable will benefit very little beyond 10 processing units, whereas a program which is 95% parallelisable can still achieve significant speed improvements with over a thousand processing units.

As Moore’s Law slows, and the acceleration of individual processor speed slows, parallelisation is key to improving performance. Graphics programming is an excellent example – with modern Shader based computing, individual pixels or fragments can be rendered in parallel – this is why modern graphics cards often have many thousands of processing cores (GPUs or Shader Units).

See also:


欢迎投稿 职场/创业方向. 邮箱wangfzcom(AT)163.com:王夫子社区 » 职场定律|阿姆达尔定律(Amdahl’s Law)