Re: PHP Script Compile System
| From: | Richard Lynch | Date: | Fri, 24 Feb 2012 21:44:51 +0000 |
| Subject: | Re: PHP Script Compile System | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-58033@lists.php.net to get a copy of this message | ||
On Wed, February 22, 2012 3:45 am, Flavius Aspra wrote:
> On 02/22/2012 07:29 AM, Rasmus Lerdorf wrote:
>> complicated optimization passes or any of those things
>
> Would such things be welcome/needed in the engine or as an extension?
Note that he said "complicated" :-)
There are many trivial / easy optimizations of low-hanging fruit.
It's just the out-of-band not-in-real-time complicated ones that PHP
doesn't do, shouldn't do, and won't do.
So if you find a quick easy one, it's most welcome...
The complicated ones, not so much :-)
PS
The misinformation that opcode caches "save" compilation time
routinely rears it's ugly head. Opcode caches save disk reads. Using
the already-opcoded chunk is just gravy, because the cache does this
(grossly over-simplified):
if ($opcode = opcode_cache_get($filename)){ //added by opcode cache
//do no disk I/O EXPENSIVE
//Oh, and for gravy, don't compile it.
}
else{
$source = file_get_contents($filename); //EXPENSIVE
$opcode = php_compile($source);
}
php_execute($opcode);
instead of this:
if ($source = opcode_cache_get($filename)){ //added by opcode cache
//do no disk I/O EXPENSIVE
}
else{
$source = file_get_contents($filename); //EXPENSIVE
}
$opcode = php_compile($source); //cheap and easy small optimization
missed
php_execute($opcode);
--
brain cancer update:
http://richardlynch.blogspot.com/search/label/brain%20tumor
Donate:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FS9NLTNEEKWBE