Hacker News new | ask | show | jobs
by dh2022 6 days ago
The formula for calculating the % improvements is wrong.

The correct formula is 100% - t_after / t_before.

The formula in the article seems to be t_before / t_after - 100%. This is incorrect.

For example if t_after is very small (meaning a very efficient calculation with a lot of improvement) this formula would indicate more than 100% improvement (and this is clearly incorrect)

1 comments

If something is 100% faster, it's 2x as fast, or 50% less in run time. Patterson and Hennessy in Computer Architecture define "X is n% faster than Y" as the value of n satisfying

    Time_X/Time_Y = 1 + n/100,
which is exactly your latter formula.