Because the Hardening-Patch adds additional security hardening checks all over the PHP code tree there have been questions about their speed impact.
- CPU: Intel(R) Pentium(R) 4 CPU 2.80GHz
- RAM: 512 MB
- PHP 5.1.4
- Hardening-Patch 0.4.11 and 0.4.12-dev in default configuration
The Zend engine comes with a little benchmark script called bench.php that was used to retrieve the following numbers. When looking at the numbers, keep in mind, that this kind of benchmark does not show the real speed impact on PHP web-applications.
The resulttable means, that PHP with Hardening-Patch 0.4.11 was 14.64% slower than plain PHP in the test. However in this table you can see, that this difference was mainly caused by the 2 tests mandel and heapsort. If you leave both tests out of the evaluation 0.4.11 is only 3.08% slower. This observation resulted in a code change in zend_hash.c which improved Zend Hashtable Canary performance a lot. Hardening-Patch 0.4.12-dev is now only 4.37% slower than a plain PHP in the overall benchmark.