Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Premature and micro optimization...

by bart (Canon)
on Jun 11, 2007 at 12:05 UTC ( [id://620474]=note: print w/replies, xml ) Need Help??


in reply to Premature and micro optimization...

Not only are you micro-optimizing, but you're looking, IMO, at the wrong spot. Inlining the code, thus not calling a sub, might produce a lot more savings in execution time, than skipping tr.

And even then, you should consider the bigger picture: how much of your total execution time is spent in thi sub? Not much, that's my guess.

Replies are listed 'Best First'.
Re^2: Premature and micro optimization...
by chargrill (Parson) on Jun 11, 2007 at 12:28 UTC

    Right - the purpose was not to micro-optimize.

    The purpose was that someone suggested that a simple change might have a negative impact on everything (needlessly applying tr/// on all IDs). I didn't think it would matter, I had time to kill, and I was curious if the impact would be measurable or not.


    --chargrill
    s**lil*; $*=join'',sort split q**; s;.*;grr; &&s+(.(.)).+$2$1+; $; = qq-$_-;s,.*,ahc,;$,.=chop for split q,,,reverse;print for($,,$;,$*,$/)
      Hmm, I must not have expressed myself clearly. It is not you, but your colleague who is guilty of (passive) micro-optimization, and focussing on a wrong thing.

      I agree that adding to the code and ending up with something that would appear to be faster, is indeed bizarre.

        I must not have expressed myself clearly. It is not you...

        I misunderstood you the same way. Can I suggest that the problem was that you said "you" when you meant "he"?

        Your original post had:

        Not only are you micro-optimizing, but you're looking, IMO, at the wrong spot.
        Hope this helps.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-20 04:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found