How should I calculate the percentage improvement in response time.
I am getting 15306 ms
response time for old code and 799 ms
response for th
I think the answers above suffer from the original question not having nice round numbers and that there are 3 different ways to state the result.
There's clearly a 50% reduction (or decrease) in the new time:
(old-new)/old x 100% = (10-5)/10 x 100% = 50%
But when you talk about an increase in performance, where a bigger increase is clearly better, you can't use the formula above. Instead, the increase in performance is 100%:
(old-new)/new x 100% = (10-5)/5 x 100% = 100%
The 5 second time is 2x faster than the 10 second time. Said a different way, you can do the task twice (2x) now for every time you used to be able to do it.
old/new = 10/5 = 2.0
The old time was 15306 ms
and the new time is 799 ms
.
There is a 94.7% reduction in time.
(old-new)/old x 100% = (15306-799)/15306 x 100% = 94.7%
There is a 1816% increase in performance:
(old-new)/new x 100% = (15306-799)/799 x 100% = 1815.6%
Your new time is 19x faster:
old/new = 15306/799 = 19.16