On Thu, 07 Jan 2010 22:48:59 -0500, (Robert Cummings) 
wrote: wrote:
Thank you all for your comments. I did not know about bytecode caches. They're 
interesting concept, but if I am interpreting the paper correctly they 
only double
the average speed of operation, which is rather less than I would have anticipated.
I strongly advise that you take the time to try a bytecode cache. Within linux environments I am partial to eaccelerator. In IIS environments I now use WinCache from Microsoft. From my own observations with a multitude of different types of PHP web applications I find that the speed gain is closer to 5 times faster on average.

Five times faster is certainly more attractive than twice as fast. But under 
circumstances is this achieved? Unfortunately these days it is difficult to 
find any solid
information on how things actually work, but my impression is that caches only 
work for
pages which are frequently accessed. If this is correct, and (as I suspect) 
somebody looks
at my website once an hour, the page will not be in the cache, so it won't 
help. Also one
of the more popular parts of this website is my photo album, and for this much 
of the
access time will be the download time of the photos. Furthermore as each 
visitor will look
at a different set of photos, even with heavy access it is unlikely that any 
given photo
would be in a cache.

A particular cache of bytecode is usually pushed out of memory when the configured maximum amount of memory for the bytecode cache is about to be exceeded. Additionally, the particular cache that gets eliminated is usually the oldest or least used cache. Given this, and your purported usage patterns, your pages will most likely remain in the cache until such time as you update the code or restart the webserver.

Despite these comments the access times for my websites seem to be pretty good 
certainly a lot better than many commercial websites -- but have a look at, and see what you think. (I am in the process of 
updating this,
and know that the technical notes are not currently working, but there is 
plenty there to
show you what I'm trying to do.)

I'm not disputing your good enough statistics. I'm merely asserting that a bytecode cache will resolve your concerns about file access times when your code is strewn across many compartmentalized files. In addition, I am advising that it is good practice to always install a bytecode cache. One of the first things I do when setting up a new system is to ensure I put an accelerator in place. Once it's in place, no matter how many pages or sub sites I put up, the accelerator is already in place and providing benefits.

Application and Templating Framework for PHP

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to