-
-
Notifications
You must be signed in to change notification settings - Fork 384
Closed
Labels
Description
Q | A |
---|---|
php-code-coverage version | 10.1.3 |
PHP version | 8.2 |
PHPUnit version (if used) | 10.3.3 |
Changes merged in #1005 and released 10.1.3
made Report\PHP
unusable as now it always consumes too much memory.
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.
#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:
-
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
package -
SebastianBergmann\PHPCOV\Command
should generate theReport\PHP
as first in the list for the same reason