-
-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speedup #387
Speedup #387
Conversation
9f6f381
to
8866c89
Compare
@@ -7,10 +7,16 @@ All notable changes of the PHP_CodeCoverage 3.0 release series are documented in | |||
### Changed | |||
|
|||
* It is now mandatory to configure a whitelist | |||
* Merged [#384](https://github.com/sebastianbergmann/php-code-coverage/pull/384): Performance improvements | |||
* It is now mandatory to configure a whitelist | |||
* Merged [#384](https://github.com/sebastianbergmann/php-code-coverage/pull/384): Performance improvements | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These duplications need to be cleaned up
798fcfa
to
df9ddc8
Compare
I have now refactored the changes and re-introduced the processUncoveredFilesFromWhitelist. It now runs each test first to determine the covered lines/files, then it can use the coverage data to then determine uncovered files. |
Is this ready for me to look at, @MajorCaiger? Thanks! |
Yes please |
There are test failures:
|
Yikes, looks like I'm not quite there. When I tried to run the tests on master they were failing but they aren't now. I'll investigate. |
e2a7fe6
to
bbd500b
Compare
This merge request was started before version 3.0 was released and this was something you added when you tidied up the original merge request. What would you like me to do about it? |
The blacklist is gone and the whitelist is now mandatory. This was not only done to make this speedup refactoring easier but most importantly to promote best practices. |
Shall I just remote the line from the change log? Or should I create a new change log? If so what version? |
I think it would be best if the Does it make sense for me to review the branch right now or are you still working on things? |
OK, I have removed the ChangeLog changes. I think it is ready for review. All tests pass and I have run the unit tests with coverage on another project with and without these changes and got the same output. |
I tried the masterspeedupThe report generated by |
Hmm back to the drawing board then. I will take a look at the config from the money repo and see what I am missing. Thanks |
I have rebased and squashed the commits as they were getting a little messy. I have altered the changes now so that all tests still pass, it shouldn't effect the outcomes of any other test suite (but I would be grateful if you could double check this). You now only get the speed improvements if you are running with processUncoveredFilesFromWhitelist turned on, otherwise there is no way of telling which files we can include_once prior to running the tests. |
Shouldn't include a test for scenarios like the money repo? |
- Init data by running xdebug with 'unused' and 'dead code' flags on all whitelist files - Run xdebug without flags for each test method - Cache num lines check for each file, to prevent superflous checks - (SB) Fix CS/WS issues
8eb6056
to
605738a
Compare
I just rebased the branch to ease testing of its changes together with changes by @Maks3w. |
if ($determineUnusedAndDead) { | ||
xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE); | ||
} else { | ||
xdebug_start_code_coverage(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Path coverage will need all flags enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway path coverage in this point only facilitate ccn so it's ok.
I guess this is an alternative to sebastianbergmann/phpunit#1878 |
Re: #387 (comment) My plan is to merge the path coverage related changes before the speedup changes. We'll have to see then how the speedup changes need to be adapted. |
any news on this? |
Guys please keep us updated |
Any updates on this feature? Our tests which usually run in total of 3 minutes (without code coverage) run with code coverage in 1:30h. I guess a more PHPUnit related question: Is there a way to execute code before and after the public function setUp()
{
xdebug_stop_code_coverage();
...
xdebug_start_code_coverage();
} I would like to avoid adding the xdebug function calls everywhere. |
Closing because this has run out-of-sync with |
Has any one thought about trying this out again? @MajorCaiger? 😃 The speed improvements mentioned as part of this (in #384) sounded very promising. 👍 |
Yeah, the changes got merged here :) |
Hi @sebastianbergmann
Here are the speedup changes so far. Not sure if there is anything else that needs changing if the whitelist is to be mandatory. If you want to give it a quick check over and let me know if there is anything missing.
Thanks
Rob