From the course: Faster Python Code

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Amdahl's Law

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…

Contents