From the course: Faster Python Code

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Amdahl's Law

Amdahl's Law - Python Tutorial

From the course: Faster Python Code

Start my 1-month free trial

Amdahl's Law

- [Instructor] Modern computers have more than one core and can execute several computations in parallel. Currently, my machine is running more than 200 processes on four cores. The operating system gives each process a slice of time to run on a specific core and then suspends that process. This gives the illusion of parallelism and is known as concurrency. If you want to learn more, I highly recommend watching Rob Pike's excellent talk: Concurrency is not Parallelism. Spreading our computation over several cores or even letting some computation happen while other units of work are waiting can significantly speed up our code. An example of waiting will be database returning results. Before you start parallelizing all your code, take some time to learn about the theory behind it. One very useful piece of knowledge is Amdahl's law, which gives the theoretical limit on speedup or latency you can get from going parallel. For example, if you have a program that runs in 10 minutes and…

Contents