Question

This is homework.

The problem: A program has 20% memory accesses, 50% multiplications, and the rest for other functions not related to either. If an overall speedup of 1.2 is desired, how much speedup would be required for both memory accesses and multiplication if both were improved equally.

I think I know how to do this if I'm looking for the speedup in one or the other using Amdahl's law, but I'm not sure how to approach this problem to find the speedup for each if they are improved equally.

If it was just looking for memory accesses, I think I would solve the following equation for x:

1.2 = 1/[(1 - 0.2) + 0.2/x]

Is the key to combine the two percentages and use 0.2 + 0.5 = 0.7 in Amdahl's law?

Was it helpful?

Solution

Suppose current execution time is 100 seconds.

Desired speedup is 6/5, so that means the new time over the old time should be 5/6, a reduction of 16.67% or 16.67 seconds. (That's all Amdahl's law is!)

You know that 20 seconds are spent in memory access, 50 seconds are spent in multiplication, and 30 seconds in other stuff.

The question "if both were improved equally" is ambiguous. Does it mean both reduced by the same absolute amount, which would be half of 16.67 each, or does it mean they are reduced proportionally, 2/7 of the 16.67 seconds coming from memory, and 5/7 of it coming from multiplication?

You take it from there!

BTW: When academics talk about performance tuning, they tend to have in mind little 1-page programs where memory accesses and math operations and big-O is what it's all about. Real-world performance tuning is very different. It is about finding out how the software is over-designed and using performance diagnostics (like profiling, but better) to find out where the fat is and cut it away, in multiple iterations. Example.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top