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

Re: Does one encapsulate a class from itself?

by chromatic (Archbishop)
on Mar 06, 2008 at 18:05 UTC ( [id://672528]=note: print w/replies, xml ) Need Help??


in reply to Does one encapsulate a class from itself?

On the other hand, I've got many, MANY operations to do, and adding a few million subroutine calls slows things down significantly (but not insufferably).

Did you measure it?

  • Comment on Re: Does one encapsulate a class from itself?

Replies are listed 'Best First'.
Re^2: Does one encapsulate a class from itself?
by amarquis (Curate) on Mar 06, 2008 at 19:39 UTC

    Yes. I do not remember the exact results, but I expected a noticeable difference since each get/set does data validation (since my accessors are part of the external interface, they have to make sure everything coming in is kosher. The module itself already knows it has "good" data and can just push it into the array, or update a cell).

    I could fix this by having internal only accessors, like ikegami mentions. I'll try it and see if the difference is measurable.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2026-01-16 12:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (118 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.