PHP 8.1: real-life performance benchmarks

Written by / Original link on Nov. 25, 2021

I did a very quick performance test because I wanted to know the impact of PHP 8.1 on my real-life projects.

These benchmarks were taken on my local machine, and only meant to measure the relative difference between PHP 8.0 and 8.1. I benchmarked a page that showed lots of data, with lots of classes loaded, as I expected that inheritance cache would have the largest performance impact.

Metric PHP 8.0 PHP 8.1
Requests per second (#/sec) 32.02 34.75
Time per request (ms) 31.232 28.777

The results seem to be in line what what Dmitry originally reported when he added this feature: a 5-8% performance increase.

Noticed a tpyo? You can submit a PR to fix it. If you want to stay up to date about what's happening on this blog, you can follow me on Twitter or subscribe to my newsletter: Email Subscribe

« PHP 8.1 Is Released! - Automatically skip sponsored segments in YouTube videos with SponsorBlock »