Our coverage.php file went from 29 Mb to 737 Mb, re-processing it with phpcov or any other tool skyrockets the memory used from < 1 Gb to > 4 Gb, with no control over it and, most important, no real benefit for the purposes of re-processing many times the Report\PHP file.
https://github.com/sebastianbergmann/php-code-coverage/pull/1005 is good because when you use many Report\*, the Directory is build only once and PHPUnit's report generation is faster, but Report\PHP should serialize the CodeCoverage object without the $this->cachedReport property filled.
I suggest the following improvements:
[x] Report\PHP should serialize the CodeCoverage object with the cache cleared using a new @internal API such as CodeCoverage::clearCache (different from the currently present CodeCoverage::clear which has another purpose)
[x] PHPUnit\Runner\CodeCoverage should generate the Report\PHP as first in the list, so that when it's processed no cache has been already built; the aforementioned API CodeCoverage::clearCache would be practically useless, but it's still needed to ensure consistency of php-code-coverage package
Changes merged in https://github.com/sebastianbergmann/php-code-coverage/pull/1005 and released
10.1.3
madeReport\PHP
unusable as now it always consumes too much memory.Our
coverage.php
file went from29 Mb
to737 Mb
, re-processing it withphpcov
or any other tool skyrockets the memory used from< 1 Gb
to> 4 Gb
, with no control over it and, most important, no real benefit for the purposes of re-processing many times theReport\PHP
file.https://github.com/sebastianbergmann/php-code-coverage/pull/1005 is good because when you use many
Report\*
, theDirectory
is build only once and PHPUnit's report generation is faster, butReport\PHP
should serialize theCodeCoverage
object without the$this->cachedReport
property filled.I suggest the following improvements:
Report\PHP
should serialize theCodeCoverage
object with the cache cleared using a new@internal
API such asCodeCoverage::clearCache
(different from the currently presentCodeCoverage::clear
which has another purpose)PHPUnit\Runner\CodeCoverage
should generate theReport\PHP
as first in the list, so that when it's processed no cache has been already built; the aforementioned APICodeCoverage::clearCache
would be practically useless, but it's still needed to ensure consistency ofphp-code-coverage
packageSebastianBergmann\PHPCOV\Command
should generate theReport\PHP
as first in the list for the same reason