Re: OOP Static Functions vs. Objects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Apr 30, 2006, at 8:07 PM, Richard Lynch wrote:

Instantiating an object does have some extra overhead that the static
call bypasses.

How much overhead depends on the complexity of the object, I would
predict that it's mainly in its constructor and any parent
constructors.


Well there's a big bowl of duh that I hadn't even thought of. Thanks for pointing that out!

What I was mainly thinking of though, what kind of hoops does PHP jump through to take a class, that I assume it's holding in memory, and make an object out of it, aside from the constructor? Is it doubling the memory consumption, or more, to do that by having the class and an object ready to work on? Are objects stored differently from included classes? Or is it treating it like object references(?) and only making a copy when it's necessary? Or something else entirely?

Of course I'm starting to worry about all this as I'm watching the number of classes, and right now objects, grow to, what seems to me, an astronomical number. Thinking in terms of the UML design it all makes sense, but I'm starting to get concerned about the impact on performance. But then I look at some of the other frameworks and they seem to be doing mostly the same thing I am. Eh.

Thanks!
Ed

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux