A program takes 100 seconds to execute. 20% of the instructions are multiplicati
ID: 3635232 • Letter: A
Question
A program takes 100 seconds to execute. 20% of the instructions are multiplication instructions. 50% are memory accesses and 30% are arithmetic instruction. Two programmers decide to make some changes to the program. Programmer A made multiplication instructions 5 times faster but caused the memory instructions to run in twice the original time (of memory instructions). Programmer B made changes to the program such that memory access became two times faster than the original. But that slowed down the multiplication instructions by a factor of 4. Which of the two programmers improved the performance the most? Show the appropriate calculations.Explanation / Answer
Same idea as the last one: Mu: 20 * 1 Me: 50 * 1 Ot: 30 * 1 T = 20 * 1 + 50 * 1 + 30 * 1 A: Mu: 20 * 1/6 Me: 50 * 2 Ot: 30 * 1 Ta = 20 * 1/6 + 50 * 2 + 30 * 1 Ta = 3.3 + 100 + 30 = 133.3Sec B: Mu: 20 * 2 Me: 50 / 2 Ot: 30 * 1 Tb = 20 * 2 + 50 / 2 + 30 * 1 Tb = 40 + 25 + 30 = 95 Looks like programmer B actually got it to run quicker, good for him!
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.