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

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 browsing the Monastery: (5)
As of 2021-04-14 06:00 GMT
Find Nodes?
    Voting Booth?

    No recent polls found