in reply to Re^2: Is there a difference in this declaration? (insignificant)
in thread Is there a difference in this declaration?

"You've fallen for the classic fallacy ..."

Utter rubbish! I've "fallen" for no such thing.

Before posting, I'd assumed the assignment incurred some overhead but also considered that an optimisation might have been applied to negate this. I chose to check it.

The benchmark code indicated the overhead did exist: I posted the code and results to show this. I made no inferences nor offered any conclusions about the benchmark results.

I wrote that the overhead was "typically negligible". I see that you excluded that from your opening quote.

Anything, no matter how small, when multiplied enough times will become a bigger thing: that bigger thing "may be significant".

-- Ken

  • Comment on Re^3: Is there a difference in this declaration? (insignificant)

Replies are listed 'Best First'.
Re^4: Is there a difference in this declaration? (insignificant)
by tye (Sage) on May 10, 2014 at 02:26 UTC
    I see that you excluded that from your opening quote.

    I see that you excluded part of what I said from your opening quote:

    Note that none of this is meant as much of a criticism of what you wrote.

    But you certainly seemed to have taken it that way. Understandable, though, despite the disclaimer.

    But I will object to one new thing you added:

    Anything, no matter how small, when multiplied enough times will become a bigger thing: that bigger thing "may be significant".

    That math doesn't actually work very well when talking about code optimization. The more you multiply the code, the more the significance ends up being divided.

    Heck, you can't even multiply the results from Benchmark.pm by just 1. Benchmark.pm starts by telling you that something takes 150% (or 100%) more time and then I multiply the code with a 10,000-iteration loop and the difference is divided by 2 or 3 (down close to the maximum possible difference you can actually achieve even with completely contrived code, because real code doesn't have the option of ignoring overhead, like Benchmark.pm tries to do).

    - tye