Michelle
Michelle

Reputation: 103

Performance improvement Calculation mumbo jumbo

Well the other day I improved the performance of a particualr piece of code from 34sec to 2 sec and I was calcuating the percentage for the same i.e (34-2)/34 i.e 94.11 percentage and when I told this number out in a meeting people were not that amazed.. I am wondering if that was a wrong number that I communicated..

How do you generally measure the improvement and look good at the same time?

Upvotes: 10

Views: 10892

Answers (4)

nurdyguy
nurdyguy

Reputation: 2945

First off, you have to be very careful how you phrase it. To say that something is twice as fast is the same as saying it improved by 100% which is the same as saying it is 200% of what it was (whatever that reference is to). When you say "improved" or "increased" then you have an implicit reference to the original amount + improvement.

Example: You have $3. You double your money to $6. That is a 100% improvement (or a 100% increase) because you have the original $3 + new $3 (which is equal to 100% of the original amount). But you could also say you have 200% as much as you had before because $3*200% = $3*2 = $6.

Now, as far as speed goes, think of this in terms of the old Algebra equation: Rate*Time=Distance. Except for us, "Distance" is more like "Job performed".

So, if a specific job takes 1 second originally and you changed things to make it perform that same job in 0.5 seconds: Original

R*1sec = 1job

R = 1job/1sec = 1 job/sec

New R*0.5sec = 1job

R = 1job/0.5sec = 2 job/sec

Thus, your speed doubled. You could say the rate increased by 100% or that the rate doubled or that it is 200% as fast as it used to be.

--------------------edit to use OP's numbers------

Original

R*34sec = 1job

R = 1job/34sec = 1/34 job/sec = 0.029 job/sec

New

R*2sec = 1job

R = 1job/2sec = 1/2 job/sec = 0.5 job/sec

So, to compare the rates 0.029 job/sec to 0.5 job/sec

0.5/0.029 = 17

Thus the new code runs 17x faster, or is 1700% as fast, or is increased by 1600%.

Upvotes: 2

Olof Forshell
Olof Forshell

Reputation: 3274

How about "executes in one seventeenth of the time" or plain "requires two seconds compared to thirty-four previously"?

Upvotes: 0

Tod
Tod

Reputation: 8242

I think I would have said "I increased the speed by better than a factor of 16" or "I made it an order of magnitude (base 16 of course) faster." If you want to look good at the same time you probably need to go buy new clothes. (Of course I've hung out with marketing weenies for too long - so I use phrases like "better than" because it sounds like the sky's the limit.)

Upvotes: 1

Paul R
Paul R

Reputation: 212979

Speed (or throughput) is proportional to the reciprocal of time. So it's actually a factor of 34/2 = 17x faster (which you can state as a (34-2)/2 = 1600% speed increase if you want to sound impressive).

Upvotes: 13

Related Questions