Roave / BetterReflection

:crystal_ball: Better Reflection is a reflection API that aims to improve and provide more features than PHP's built-in reflection API.
MIT License
1.19k stars 131 forks source link

CI: use pcov for type coverage #1397

Closed staabm closed 8 months ago

staabm commented 8 months ago

just a test whether this speedsup the CI pipeline

Ocramius commented 8 months ago

The biggest offender when it comes to performance here is roave/infection-static-analysis-plugin operating (under the hood) with Psalm's analysis, which needs more tuning around file consistency checks, perhaps.

It's still faster than running all the mutants, but it's also still very slow when considering analysis on a limited set of changed files.

staabm commented 8 months ago

I need to dive into roave/infection-static-analysis-plugin to understand more what it is actually doing :-).

my naiv thinking of this PR was/is: xdebug makes everything super slow. maybe pcov does have less function call overhead etc and might speedup it. lets see.

Ocramius commented 8 months ago

It's really tiny. For each escaped mutant process (generated mutation), it will run static analysis:

https://github.com/Roave/infection-static-analysis-plugin/blob/063ab39377a515ec115d6480367d41d0f1a894a7/src/Roave/InfectionStaticAnalysis/RunStaticAnalysisAgainstEscapedMutant.php#L36-L71

In there, the major-major performance bottleneck is:

if ($this->runStaticAnalysis->isMutantStillValidAccordingToStaticAnalysis($mutantProcess->getMutant())) {
staabm commented 8 months ago

do you think we could use --filter and run several jobs in parallel ?

https://infection.github.io/guide/command-line-options.html

Ocramius commented 8 months ago

Possibly, but CI is not as frequent here, so 15m are not worth wasting time on, unless you are looking for very specific mutants.