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

Re: Faster with my keyword or no ?

by BillKSmith (Monsignor)
on Nov 24, 2021 at 04:18 UTC ( #11139068=note: print w/replies, xml ) Need Help??


in reply to Faster with my keyword or no ?

We strongly recommend that you always use strict in every script. Under strict, you must declare all your variables (my for lexical, our for global). Without strict, all variables default to 'package'. Your question becomes "Which type of variable is faster?" I doubt that it makes much difference.

In general, It is better to have a program that is easy to maintain than it is to have one that is marginally faster. ('strict' and 'my' offer several advantages to the maintainer.) The usual recommendation is to not even consider execution speed until you have a complete program that works correctly, but is unacceptably slow. At that point, profile it to identify the problem area. Write several versions of this code. Benchmark each with realistic data. (You will almost always be surprised by the result). Resist the temptation to make "easy changes" to speed-up other sections. Even a big improvement will make little difference in your complete program.

Bill

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2022-01-24 14:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (64 votes). Check out past polls.

    Notices?