Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by Happy-the-monk (Abbot)
on Jul 07, 2006 at 19:29 UTC ( #559856=note: print w/replies, xml ) Need Help??


in reply to Re^2: 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?

While you're often right with this, and certainly in this case too (++), be careful not to generalise:

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

Cheers, Sören

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

Replies are listed 'Best First'.
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
    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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://559856]
help
Chatterbox?
[Eily]: and I'm pretty sure there's a rule somewhere that states that the stupider the idea, the more likely it is to already have been done
zentara is thinking of moving to Mars to esacpe it all
[LanX]: Zentara eq Dr Manhatten ?
[zentara]: more like Dr. Helion3 :-)
[LanX]: Eily: though I haven't found a a reference for this one yet : Re^2: OT: Got fired this week (orange)

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (12)
As of 2017-03-27 15:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (320 votes). Check out past polls.