Problem/Motivation
https://github.com/phpstan/phpstan/discussions/7923#discussioncomment-45...
PHPStan maintainer (thanks!) found out that by enabling bleeding edge features, the running time of a full PHPStan scan reduces significantly.
Proposed resolution
Enable bleeding edge features on PHPStan.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3330673-2.patch | 336 bytes | mondrake |
Comments
Comment #2
mondrakeSmall patch, big performance improvement
Comment #3
andypostThe log looks strange https://dispatcher.drupalci.org/job/drupal_patches/160397/artifact/jenki...
How to measure?
Comment #4
spokjeThe "non-text-only" log of a CI run has start and end times in front of every line, so let's take that as a measurement for now?
Grabbed three random core issues from the first page of the issue list and came up with:
https://dispatcher.drupalci.org/job/drupal_patches/160425/consoleFull
Time spend in PHPStan-land: ~2m54s
https://dispatcher.drupalci.org/job/drupal_patches/160417/consoleFull
Time spend in PHPStan-land: ~2m50s
https://dispatcher.drupalci.org/job/drupal_patches/160431/consoleFull
Time spend in PHPStan-land: ~2m53s
Now for this issue:
https://dispatcher.drupalci.org/job/drupal_patches/160397/consoleFull
Time spend in PHPStan-land: ~1m33s
So that looks like a really nice speed-up.
Of course, n is too small, calculations too sloppy, etc., but I'm going or an RTBC for this one.
EDIT: The only thing that might be of concern is that "bleeding edge" is supposed to land somewhere in the next releases? If so, we then have that performance in a normal version and the then-bleeding edge might be something that shoots us in the foot?
To many unknowns for me there, but still, shaving off 40(?)% of our PHPStan-land-time for all testruns on d10 is enough to keep my RTBC standing for now.
Comment #5
catchThis is true but we'd just need to remove it again? The maintainer said this should be in phpstan 2.0, so should we open a follow-up to remove bleeding edge when we upgrade to phpstan 2?
Very +1 for trying this. I have changed computer in the past couple of months, but before that I wasn't able to run phpstan locally without limiting the number of processes, and I think @xjm has a similar issue now, so this will have a significant material effect on committing core patches apart from the general speedup for hopefully everyone.
Comment #6
mondrakeIt's a one-line change. If for any reason bleeding edge will stop working for us, we'll remove that one line and run with ballast again...
Just to say that IMHO there's no need to anticipate removing that when PHPStan 2.0.0 is out, let's pragmatically see when it will be needed.
Comment #7
catchYeah #6 is also fair enough for me.
Comment #8
spokjeAll for this change, my (very beefed up) dev-laptop almost takes off during a full PHPStan run, just wanted to point out what _might_ happen. That's fully addressed now :)
Comment #9
alexpottBackported to 10.0.x since this is core's phpstan conf and we can back this out the moment we need to.
Committed and pushed a4bda74289 to 10.1.x and 19131be388 to 10.0.x. Thanks!