Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^7: Speed Improvement (insignificant)

by McA (Priest)
on Dec 03, 2014 at 08:40 UTC ( [id://1109089]=note: print w/replies, xml ) Need Help??


in reply to Re^6: Speed Improvement (insignificant)
in thread Speed Improvement

Hi tye,

first of all: I just like these kinds of threads. Really. You see several approaches, the monks participating start to get little boys (me too) presenting the hopefully fastest approach. Many approaches are sources for new ideas or point of views. Some approaches are just beautiful (a personal taste of source code beautiness).

There have been many discussions about whether microbenchmarks are meaningful. Yes, of cource. The context of the original question is missing to judge whether an optimization in this field matters or not.

But we learned also: Don't trust a statistics which you haven't forged yourself. ;)

I learned that a short time of studying before starting to work (even when this kind of studying is just making nothing) can result in an extraordinary performance boost (by just doing something different and letting people believe you did what they want). These are the lessons of and for life... :))

Last but not least: As you said by yourself, the original post made you laugh. That's not the worst, is it?

Regards
McA

Replies are listed 'Best First'.
Re^8: Speed Improvement (insignificant)
by tye (Sage) on Dec 03, 2014 at 09:19 UTC

    You seem to think that I was advocating that this thread should have never happened. Trying to optimize such tiny operations (certainly in Perl) is really just a waste of time as far as achieving actual practical performance improvements. Certainly, it can be fun.

    I occasionally enjoy Perl "golf". But I really doubt anybody thinks such code is meant to provide examples of how best to get real work done. Have fun, but where is the harm in having the fun while being aware of the practical meaninglessness of the scores being measured? Do you think the original author is going to pick an approach based on much of anything beyond these scores after such an opening sentence (especially when nobody will even hint at how insignificant the scores will end up being in practice)?

    Do you object to GotToBTru perhaps learning a little such that they could avoid again jumping to invalid conclusions based on reports from Benchmark?

    The context of the original question is missing to judge whether an optimization in this field matters or not.

    Not really. That these alternatives will have almost no impact in a full script is easy to predict from evidence already presented: The high iterations/sec of even the slowest version, the fact that something practical is desired, and that this program will be written in Perl. That "messages" are being constructed just adds another nail to the coffin.

    You can even tell Benchmark to notify you when it is producing especially pointless numbers. Just set the iteration count to something reasonable like 10_000. If you get told "too few iterations", then the resulting numbers (no matter how high you raise the iteration count) are more fiction than they are useful.

    The math of how performance changes of very small operations very quickly become completely insignificant is quite simple (more "arithmetic" than "math"). And I didn't plan to rehash such in this thread.

    Sorry to have interrupted your "learning" with stuff I guess you didn't want to learn? :)

    - tye        

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1109089]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-04-23 20:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found