|
|
|
php世界中三个主流的能够实现编译cache的工具是:
The Zend Accelerator—A commercial, closed-source, for-cost compiler cache produced by Zend Industries
The ionCube Accelerator—A commercial, closed-source, but free compiler cache written by Nick Lindridge and distributed by his company, ionCube
APC—A free and open-source compiler cache written by Daniel Cowgill and George Schlossnagle
APC的安装方法,APC包含在PECL中,具体安装如下 190-823 190-802 :
运行命令
#pear install apc
之后,在php.ini文件中添加:
extension = /path/to/apc.so
疑问:对于自上次编译后变动了的php,APC是否能够自动重新编译?
The Zend Optimizer is a closed-source but freely available optimizer.
The ionCube accelerator contains an integrated optimizer.
proof-of-concept optimizer in PEAR.
优化器主要的功能:
1、清除无用的代码,例如永远也不会执行的死代码。
2、常量的计算,例如将$seconds_in_day = 24*60*60直接变为$seconds_in_day = 86400;
3、其它代码优化功能,例如有这么一个语句:
$count++;
会优化为++$count,使得执行速度更快。 当然,如果语句是$i = $count++;则不会进行优化
评论 {{userinfo.comments}}
{{child.content}}
{{question.question}}
提交