[pLog-svn] caching
Jon Daley
plogworld at daley.snurgle.org
Mon Jun 6 20:29:39 GMT 2005
I believe we were pointed to this link by someone (Ben?) a while ago.
http://phplens.com/lens/php-book/optimizing-debugging-php.php
I finally got around to reading, and came across a couple interesting
(non-intuitive, at least until you are told about them)
Incrementing an undefined local variable is 9-10 times slower than a
pre-initialized one.
> Initialise all variables before use.
> Dereference all global/property variables that are frequently used
> in a method and put the values in local variables if you plan to
> access the value more than twice.
Methods in derived classes run faster than ones defined in the base class.
> Try placing frequently used methods in the derived classes.
In PHP 5, all objects are passed by reference automatically, without the
need of an explicit & in the parameter list. PHP 5 object performance
should be significantly faster.
**************************************************************
* Jonathan M. Daley * You are only as wise as *
* jondaley at snurgle.org * others perceive you to be. *
* www.snurgle.org/~jondaley * -- M. Shawn Cole *
**************************************************************
More information about the pLog-svn
mailing list