Performance/caching of PHP classes
Posted: Thu Sep 01, 2005 6:09 pm
I am new to PHP (although not inexperienced in web development) and am curious as to how the Zend engine handles the caching of previously interpreted PHP code.
I have developed a new web application that is fairly heavily reliant on PHP classes and has a reasonably complicated object model. In an environment where my PHP interpreter is loaded as a module (ie. not CGI), would I be right in assuming that the class definitions are interpreted just once and then cached internally within the Zend engine (assuming I use require_once statements)?
The reason I ask is that I don't like the thought that *every* time a user requests a page, the interpreter may have to include, validate and interpret 40 or 50 PHP files (containing many lines of PHP code).
Are there any papers on how the zend engine handles this? My performance is pretty good at the moment... I just want to make sure I understand how it works in the future if the workload increases.
Many thanks.
Craig
I have developed a new web application that is fairly heavily reliant on PHP classes and has a reasonably complicated object model. In an environment where my PHP interpreter is loaded as a module (ie. not CGI), would I be right in assuming that the class definitions are interpreted just once and then cached internally within the Zend engine (assuming I use require_once statements)?
The reason I ask is that I don't like the thought that *every* time a user requests a page, the interpreter may have to include, validate and interpret 40 or 50 PHP files (containing many lines of PHP code).
Are there any papers on how the zend engine handles this? My performance is pretty good at the moment... I just want to make sure I understand how it works in the future if the workload increases.
Many thanks.
Craig