PHP 5.6 Benchmarks
Recently I ran it again for versions PHP 5.3 through PHP 5.6 and I thought I’d share my results:
PHP’s performance has consistently improved over the versions; here I don’t show versions earlier than PHP 5.3 but that version was also much faster than earlier releases of PHP 5. I meet many applications whose PHP platform aren’t upgraded because they don’t need the new features in the new versions. This is absolutely fine, but what application wouldn’t benefit from improved performance and security?
The individual numbers, if you should want them:
|version||run 1||run 2||run 3||run 4||run 5||run 6||run 7||run 8||run 9||run 10||average|
I’m hearing some very convincing rumours about big performance improvements on the horizon for future versions PHP, and that is fantastic, but even the currently-released (or almost – 5.6 will be stable in the coming months) versions have a lot to offer PHP developers everywhere. If any paid-for platform offered this kind of improvement for free, it would be big news. Maybe we should start to shout about some of the good news in PHP too?
Hi, could you provide Gist of script and php configuration you used for test?
Ah, I didn’t outline this very well in my post. I simply took a download of each version, and ran:
The final step was run 11 times so that I could ignore the first run and capture 10 attempts to average over. It’s pretty unscientific but I hope it gives an idea of the relative performance capabilities of each version.
I’m quite excited to see what php-ng will bring. I’ve had a hobby project that hammered PHP on performance, even making me wonder if I shouldn’t rewrite it in say python or java or whatever, but I gave hhvm a whirl and was literally blown away by the performance gain. Granted this performance bottleneck was a whole load of php logic, basically a tight loop running over millions of rows and keeping track of various lists. so really something that php is known to be bad at.
I can’t wait to see how php-ng will perform.
Although I also want to look at Hack, the strong typing really appeals to me. Especially for writing robust services where you just want to be explicit all the time.
Either way I’m really liking the direction PHP is going in.
Thanks for sharing this information!
Indeed, PHP seems to be heading in the right way. The performance issues of PHP is less and less going to be an excuse not to use it. Can’t wait for PHP 6 ;)
Very useful for helping site owners understand the importance of upgrading. Unless of course they have old unmaintained code/plugins. Even then, the extra effort to achieve compatibility with latest PHP versions would still be worth it. Did you have any opcode caching enabled/disabled on all versions? For example does Zend Opcache improve speeds by the same ratio across all versions? Thanks for taking the time on this.
PHP 5.6 is out and I’m scouring the web to see if I should make the leap on my development machine. I thin I will now that it’s considered stable. I won’t expect that it will be available to my production machines for many months, though. Possibly a year at the rate that some of them update their respective repositories.
Certainly 5.6 is stable enough to use but I usually recommend that development platforms are kept at the same version as the production ones
Quite a nice performance jump for PHP 5.6. Any specific improvements responsible for this? Thanks for taking the time to post this.
Pingback: How to Choose PHP Hosting | LornaJane
Pingback: 4 things that happened in PHP while you weren't looking - O'Reilly Radar
Thanks for the post, i needed this for my clients to convince them about benefits of PHP 5.6.