Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^4: What is the difference between the constant construct in Perl and the Readonly construct in Perl?

by revdiablo (Prior)
on Jul 10, 2006 at 21:57 UTC ( [id://560255]=note: print w/replies, xml ) Need Help??


in reply to Re^3: What is the difference between the constant construct in Perl and the Readonly construct in Perl?
in thread What is the difference between the constant construct in Perl and the Readonly construct in Perl?

In many other places, speed may not be so much of an issue

Not only that, but what "speed" means can vary wildly. Performance is not a simple, single variable that can be tweaked at will. There are so many variables at play that any widely general rule is going to be wrong some time or another.

Take this specific thread as an example. This is a classic case of micro-optimization. Certainly, using constant may be way, way faster than using Readonly. But what if the majority of an application's time is spent on network IO? Does the time it takes to resolve a constant really matter? It takes careful consideration and testing in the proper context to know for sure.

To be clear, I'm not poo-pooing optimization by any means. I'm just trying to point out that it's important to optimize the right thing.

  • Comment on Re^4: What is the difference between the constant construct in Perl and the Readonly construct in Perl?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-04-24 13:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found