I've switched my biggest website (on Phalcon 3.4.2) from PHP 5.6 to PHP 7.2 and I find that it has become slower. I'd expected this to make the site faster, so I wonder why this is.
The site is on CentOS 6.10 with DirectAdmin. I used DirectAdmin to swith PHP versions, and I had updated the PHP versions and Apache 2.4 before the switch, using DirectAdmin's Custombuild.
- PHP 5.6 is mod_php
- PHP 7.2 is FPM
On a page with average functionality, I measured the time to generate the page in the front controller, right before loading the config.yaml and at the end, using the microtime() function, with a simple profiler class of my own.
On PHP 5.6 I had page generation times of 11 .. 17 ms. On PHP 7.2 times of 20 .. 33 ms. So, about doubled times, while I had expected a reduction.
Why is that? Can I do something about it?