Issues

ZF-4807: Document general PHP performance tips

Description

Comments

I hear that you can execute php faster if you set date.time_zone directive in php.ini .

origin of the information (In Japanese) ; http://d.hatena.ne.jp/sotarok/20080128/1201475353

I think that one general PHP performance tip that should be mentioned is in regards to cyclical references and memory performance.

It is my understanding that any object that has cyclical references will not be garbage collected in PHP. When a framework like zend framework is used for a longer process this can cause great problems. In my case, a script (using ZF) that only takes 26 seconds to complete keeps falling over with an out of memory error. In 26 seconds it was using over 100 MB for something quite simple. The reason? Every single data object that I had created was still in memory. As my data objects were hierarchical , they all had references to their parent and their children. This caused cyclical references and nothing was removed from memory.

I am now having to manually destruct my PHP object to achieve better memory performance.