More Related Content
Similar to Zend OPcacheの速さの秘密を探る
Similar to Zend OPcacheの速さの秘密を探る (20)
More from Yoshio Hanawa (18)
Zend OPcacheの速さの秘密を探る
- 19. OPcacheの最適化内容
substitute persistent constants (true, false, null, etc)
perform compile-time evaluation of constant binary and unary operations
optimize series of ADD_STRING and/or ADD_CHAR
convert CAST(IS_BOOL,x) into BOOL(x)
convert INTI_FCALL_BY_NAME + DO_FCALL_BY_NAME into DO_FCALL
convert non-numeric constants to numeric constants in numeric operators
optimize constant conditional JMPs
optimize static BRKs and CONTs
optimize $i = $i+expr to $i+=expr
optimize series of JMPs
change $i++ to ++$i where possible
CFG optimization
Optimize temp variables usage
remove NOPs
高度な最適化は行っていない印象
13年9月14日土曜日
- 23. 最適化の具体例(2)
可能であれば $i++ を ++$i に変える
式 $i++ の結果を利用していない場合、両者は交換可能
交換するとopcode数が減る
$i++ はZend VM上では2命令に展開される
++$i は1命令に展開される
13年9月14日土曜日