Question: Q. Suppose you are given code to analyze and optimize. The code consists of two functions f1() and f2(). Upon running a code profiler, the

Q. Suppose you are given code to analyze and optimize. The code consists of two functions f1() and f2(). Upon running a code profiler, the analysis shows that 70% of the execution time is used by f1() and the remainder by f2(). You now have a choice to modify one of the functions to speed up your codes performance.

Using Excel, create a spreadsheet as shown to show the overall speedup when f1() and f2() are optimized to run faster (Speedup is defined by Amdahls law). Show the overall speedup as the individual functions are optimized to run 1x, 2x, 3x, 20x their original speed.

Plot a line chart depicting the speedup of both f1() and f(2). (X-axis: Optimization level; Y-axis: Overall speedup)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!