So what I have is two computers X and Y. Basically, my question is which goes in the numerator for finding relative performance? If X is n times faster than Y, then the execution time of Y is n times longer than it is on X: Code: (Performance of X)/(Performance of Y) = (Execution time of Y)/(Execution time of X) = n This makes sense for the following problem: If computer A runs a program in 10 seconds and computer B runs the same program in 15 seconds, how much faster is A than B? Which yields: Code: (Performance of A)/(Performance of B) = (Execution time of B)/(Execution time of A) = n or 15/10 = 1.5 and A is therefore 1.5 times faster than B. Now, how is it that you determine to put 15 over 10 instead of 10 over 15? Sorry if this seems like a basic algebra question.. but I can't wrap my head around which goes in which spot.. obviously severely affecting the answer. Code: Another example: Program Time on M1 Time on M2 1 2.0 sec 1.5 sec 2 5.0 sec 10.0 sec Now if I want to use the same formula for program 1 above for this example to find out which computer is faster and by how much I start obviously with saying the lesser of the two is faster. Am I automatically placing the lesser(since it's the fastest) of the two in the denominator? so in this case it would be 2.0/1.5 = 1.333 or is it the better looking result of 1.5/2.0 = .75 times faster?
Look at it this way, you are trying to determine the performance one one computer, relative to another. This means, that the second computer is sort of the benchmark to which the first one is measured against. This does depend on which computer you want to be measured relative against. In your first example with 15/10, the question may be clearer if it was put What is computer B's speed relative to computer A?. In that scenario, you can find the answer by: computer A time = 10 computer B time = 15 Time relative to A = 15/10. We put the 15 first because that is the focus of the question, it is basically asking how fast B is, so we put B's speed first. If you work with percentages, this is basically the same idea. In your second example, M1 time was 5 sec, M2 is 10 sec. To find out what computer is faster, and by how much then this piece of C code will Code: void printFastestComputer(float timeComp1, float timeComp2) { if (timeComp1 == timeComp2) { printf("Both computers are the same speed"); return; } if (timeComp1 > timeComp2) { /* computer 2 is faster, so we focus on that */ float magnitude = 0; magnitude = timeComp2/timeComp1; printf("Computer 2 is %.1f times faster", magnitude); return; } if (timeComp2 > timeComp1) { /* computer 1 is faster, so we focus on that */ float magnitude = 0; magnitude = timeComp1/timeComp2; printf("Computer 1 is %.1f times faster", magnitude); return; } return; } This hasn't been tested as I only wrote this quickly, but it should give you a general idea on how you would calculate which is faster and by how much.
I think you answered it yourself didnt you? Performance of Computer A in terms of the Performance of Computer B = A/B The denominator is always the standard, or benchmark. The resulting ratio from the division is always the numerator with respect to the denominator.
It cant be 0.75 faster. It can be 3/4 the speed of the other computer or the faster computer can be 1.33 times quicker. Simply because its easier to word "one computer is 133% the speed of the other, or 1.33 times the speed of the other" id use 2/1.5. Though it makes no difference because the difference in speeds is still the same.