Recently I set up GitHub sponsors, if you my content helps you, you can consider a one-time or monthly sponsorship.

PHP 8.1: real-life performance benchmarks

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

This is where the ad would go. Instead though, I'd like to point you towards my GitHub Sponsors page. If you're a regular reader and my content is helping you, you can consider a one-time or monthly sponsorship. If you're a company looking for dedicated ad placements on this blog or my newsletter, you can email me at brendt@stitcher.io

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: