in reply to Avoiding global object handle
You dismissed method 2 as possibly being too much of a performance hit, since it involves passing a scalar variable containing a reference into each subroutine.
But your preferred method involves calling an extra subroutine every time you want to access your object. I haven't done any tests, but I'd be surprised if sticking an extra param in an existing sub call is more costly than making a whole new call. Especially if in a particular sub you do ten method calls on your object — you've now replaced one param with ten function calls.
Did you actually have a problem with your code running too slow, or did you just get the urge to do this because you suspected there might be one?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Avoiding global object handle
by Biker (Priest) on Mar 26, 2002 at 10:43 UTC | |
|
Re: Re: Avoiding global object handle
by Biker (Priest) on Mar 26, 2002 at 10:49 UTC |