News for hackers. Stuff that matters.
[deleted]
Re:Potato paradox by nightcracker on Thursday July 16, 2015 @02:24AM (#9895706)
Let's say your program takes 100 seconds, of which 99% is spent in f(). Then if you optimize f() such that only 98% of the total time spent in f, then:

    orig_time = 100
    orig_not_f = 0.01 * orig_time = 1
    new_f = 0.98 * new_total
    new_total = new_f + orig_not_f
    new_total = 0.98 * new_total + orig_not_f
    new_total - 0.98 * new_total = orig_not_f
    0.02 * new_total = 1
    new_total = 1 / 0.02 = 50