From the course: Python Parallel and Concurrent Programming Part 2

Unlock the full course today

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

Measure speedup: Python demo

Measure speedup: Python demo - Python Tutorial

From the course: Python Parallel and Concurrent Programming Part 2

Start my 1-month free trial

Measure speedup: Python demo

- [Instructor] To demonstrate how I measure the speedup of a parallel program in Python I'll be using the recursive sum algorithm that we created in an earlier video which uses a parallel divide-and-conquer approach to sum together all of the numbers within a range of values. The parallelized implementation of that algorithm is contained within the par_sum function on line 13. But since we've already covered how that works, I'll use code folding to hide it for now. The sequential summing algorithm to use for comparison is in the function on line nine, which simply uses the built-in sum function over the specified range. I'll hide that too for now. The main section of this program contains a simple framework that I like to use to evaluate performance when developing parallel algorithms. On line 28 we have a variable to indicate the number of evaluation runs to measure each implementation and then we'll average those times together. Increasing that number to average together more runs…

Contents