PHP 5.1 Performance

Over the last couple of days I benchmarked the three execution models (CALL, GOTO, SWITCH) that the new virtual machine of PHP 5.1 offers against PHP 5.0.4 and PHP 4.3.11 (results with GCC 3.4.4, GCC 4.0.1).

Initial results show that PHP 5.1's GOTO-based executor gives a 400% better performance than PHP 4 and PHP 5.0. The benchmark script used is available here.

In PHP 5.1.0 the default executor will be CALL as it is the most tested one. You can use GOTO or SWITCH by using the --with-zend-vm={CALL|GOTO|SWITCH} configure parameter. GOTO and SWITCH currently segfault on the Ackermann benchmark, but this is being worked on.