We don't bite newbies here... much PerlMonks

### Re^3: Is there a difference in this declaration? (insignificant)

by kcott (Chancellor)
 on May 10, 2014 at 01:24 UTC ( #1085636=note: print w/replies, xml ) Need Help??

"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

Create A New User
Node Status?
node history
Node Type: note [id://1085636]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2018-11-15 23:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
My code is most likely broken because:

Results (192 votes). Check out past polls.

Notices?