RE: APC optimization in CLI

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

 



> From: Robert Cummings [mailto:robert@xxxxxxxxxxxxx] 
>
> However, accelerators don't make scripts faster per se. 
> They merely cut out the script reading and parsing time. 

Which is a HUGE portion of time since PHP is a two-pass step. One that reads
and compiles to opcodes (with syntax checking) and another which actually
executes it.

> So, while 
> you may experience 10% gain within the first second of your script 
> running, the use of an accelerator should have no bearing 
> down the road 
> except for the initial dynamic load of other scripts at runtime.

This is sort of misleading.

You will experience faster page loads if it's a web php file, and if APC
does allow you to run cached scripts via CLI, then these scripts will start
execution immediately too.

> Long running scripts will see almost no benefit from an accelerator. 

PHP scripts are (like it or not) NOT designed to be daemons and run for long
periods of time. The GC is no optimized for such things. It's quite
inneficient from what I've read. The whole purpose of a PHP _page_ is to get
in and get out. Hit it and quit it. Therefore memory efficiency is not as
important as speed and ease of use.

> This is the general reason why CLI acceleration isn't very useful. That
said 
> though, one could certainly glean an advantage if they had a 
> cron job or other daemon that was loading a script often.

As is probably often the case, moreso than a "long running script".

I think a code optimizer is what would be desired if you're trying to make a
faster script. However in this day and age, I suspect that the 2nd phase of
the compiler already does all the optimizing it can before creating the byte
code. 


-- 
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