Skip to content

Commit

Permalink
feat: amdahls law (dwmkerr#47)
Browse files Browse the repository at this point in the history
* feat: added Amdhal's Law

Closes dwmkerr#46.
  • Loading branch information
dwmkerr authored Apr 4, 2019
1 parent ba43da7 commit 9795c57
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Binary file added images/amdahls_law.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9795c57

Please sign in to comment.