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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started