-
-
Notifications
You must be signed in to change notification settings - Fork 386
Faster coverage-xml report #1102
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1102 +/- ##
============================================
+ Coverage 88.53% 88.82% +0.29%
+ Complexity 1393 1391 -2
============================================
Files 98 98
Lines 4874 4652 -222
============================================
- Hits 4315 4132 -183
+ Misses 559 520 -39 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Nice! Can I bother you to squash this into a single commit with a sensible commit message? |
|
here we go |
| $writer = new XMLWriter; | ||
| $writer->openMemory(); | ||
| $writer->startElementNs(null, $this->contextNode->nodeName, 'https://schema.phpunit.de/coverage/1.0'); | ||
| $writer->writeAttribute('nr', $this->line); | ||
|
|
||
| foreach ($tests as $test) { | ||
| $writer->startElement('covered'); | ||
| $writer->writeAttribute('by', $test); | ||
| $writer->endElement(); |
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.
my feeling is, if we would work with plain strings instead of XMLWriter we may be even faster.
is this something you would be open for?
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.
No.
|
I have 2 more PRs which improve processing speed in a similar way. you may want discuss them with arne: |
before this PR
after this PR
running my benchmark based on phpstan-src codebase recorded coverage data.
this change is based on the observation that the inlined
addTestmethod is invoked ~10 million times, when running code-coverage even on a small portion of the phpstan-src codebaseXDEBUG_MODE=coverage php tests/vendor/bin/paratest --coverage-xml=tmp/coverage-xml tests/PHPStan/Analyser