Faster IntersectionType->getFiniteTypes()#4746
Conversation
|
This pull request has been marked as ready for review. |
| if ($finiteType instanceof EnumCaseObjectType) { | ||
| $oneType[$finiteType->getClassName() . '::' . $finiteType->getEnumCaseName()] = $finiteType; | ||
| continue; | ||
| } |
There was a problem hiding this comment.
using the same type description as in
phpstan-src/src/Type/IntersectionType.php
Line 1027 in 7c5aa63
|
Thank you! |
|
@ondrejmirtes since the repro from phpstan/phpstan#11968 is now below 9 seconds, it might be worth adding it as a AnalyserIntegrationTest (before we only had a stripped down version of it in the test-suite, because the original case was still too slow with 49 seconds) wdyt? |
|
I feel like in the longterm, we need a different approach to performance tests, not just shove them into AnalyserIntegrationTest. I don't want to slow down the main test suite because of them, I think that fixing bugs != performance work. I think that out of those 200 tests in AnalyserIntegrationTest, we should pick the ones about performance and have a separate job for them in GitHub Actions, maybe with phpbench, that would reliably detect when it gets slower. |
make large enum analysis faster
requires #4744
the repro from phpstan/phpstan#11968
before this PR: 32.32 seconds
after this PR: 8.57 seconds