feat: amdahls law (#47)

* feat: added Amdhal's Law

Closes #46.
This commit is contained in:
Dave Kerr
2019-04-04 12:18:24 +08:00
committed by GitHub
parent ba43da7361
commit 9795c57258
3 changed files with 25 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.DS_Store

View File

@@ -6,6 +6,7 @@ Laws, Theories, Principles and Patterns that developers will find useful.
* [Introduction](#introduction)
* [Laws](#laws)
* [Amdahl's Law](#amdahls-law)
* [Brooks's Law](#brookss-law)
* [Conway's Law](#conways-law)
* [The Hype Cycle & Amara's Law](#the-hype-cycle--amaras-law)
@@ -38,6 +39,29 @@ There are lots of laws which people discuss when talking about development. This
And here we go!
### Amdahl's Law
[Amdahl's Law on Wikipedia](https://en.wikipedia.org/wiki/Amdahl%27s_law)
> 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:
![Diagram: Amdahl's Law](./images/amdahls_law.png)
*(Image Reference: By Daniels220 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, where as a program which is 95% parallelisable can still achieve significant speed improvements with over a thousand processing units.
As [Moore's Law](#TODO) 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:
- [Brooks's Law](#brookss-law)
- [Moore's Law](#TODO)
### Brooks's Law
[Brooks's Law on Wikipedia](https://en.m.wikipedia.org/wiki/Brooks%27s_law)

BIN
images/amdahls_law.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB