Urgent.News

What's breaking now, across thousands of outlets.

Tech

PHPStan 2.3 on a Real Laravel App: What Got Faster, What Broke

PHPStan 2.3 landed on October 1 with a big promise: up to 7.5x faster than PHPStan 2.1 from last December. The numbers in the release post come from WordPress and Drupal. Nice projects, but not the kind of code I work on every day. So I upgraded a production Laravel app the same month and timed it. The cold run got two times faster. The run I make fifty times a day saved about a second. And the…

PHPStan 2.3, released on October 1, claims to be up to 7.5 times faster than its predecessor, PHPStan 2.1, from December of the previous year. However, the author decided to test the performance improvement on a real Laravel app to see if the claims held true. After upgrading to PHPStan 2.3.1, the author found that cold runs, which are the first runs after cloning the project or CI jobs that don't restore the cache, were two times faster, taking 15.7 seconds compared to the previous 34 seconds.

The median cold run time decreased from 34.0 seconds to 15.7 seconds, with the range narrowing from 27-55 seconds to 12-19 seconds. Additionally, warm runs, which are the runs made multiple times a day, saved about a second, with the median time decreasing from 2.0 seconds to 1.6 seconds. The upgrade also found no new unused-variable errors since the Rector tool had already cleaned up the code.

Overall, the author asserts that the upgrade is beneficial, but it is not as dramatic as the 7.5x claim might suggest.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Tuesday 17 November →