Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: declaring lexical variables in shortest scope: performance?

by dsheroh (Monsignor)
on Apr 01, 2020 at 07:46 UTC ( #11114884=note: print w/replies, xml ) Need Help??

in reply to declaring lexical variables in shortest scope: performance?

Perl is not, never has been, and almost certainly never will be a "high performance" language. If you're really that concerned about saving every flop, your first move should not be to question where to put my, your first move should be to switch to a different language.

As long as you avoid the big mistakes like using inefficient algorithms, optimizing for correct operation and readability is generally going to be more than sufficient. Micro-optimizing things like the placement of variable declarations is almost never worth the effort, regardless of language, because the time you spend doing the optimization will generally be many, many orders of magnitude larger than the handful of microseconds that will actually be saved by the code speedup.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2020-10-21 14:12 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (218 votes). Check out past polls.