Improve coverage speed by using new caching option for package:coverage#107395
Merged
jensjoha merged 5 commits intoflutter:masterfrom Jul 13, 2022
Merged
Improve coverage speed by using new caching option for package:coverage#107395jensjoha merged 5 commits intoflutter:masterfrom
jensjoha merged 5 commits intoflutter:masterfrom
Conversation
This was referenced Jul 13, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Jul 13, 2022
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/plugins
that referenced
this pull request
Jul 13, 2022
camsim99
pushed a commit
to camsim99/flutter
that referenced
this pull request
Aug 10, 2022
…ge (flutter#107395) Speedup coverage test runs by using (new) coverage handle with caching. On a `flutter test --coverage` run on `packages/flutter` the runtime goes from ~828 seconds to ~617 seconds, or a ~25% reduction in time spent (testing without coverage takes ~236 seconds so the overhead of `--coverage` in this case goes from ~592 seconds to ~381 seconds, or a ~35% reduction).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The running e.g.
flutter test --coverageeach test file (i.e. after each vm run of a test file) will be passed throughpackage:coveragewhich - because of the option to be able to check for ignored lines - has to read all files in the source report (in the package(s) we're getting coverage for). With many test files (and depending on the dependency graph, but still) it will then keep reading the same files over and over.In dart-archive/coverage#391 I added the ability to cache these reads and this PR utilizes this in flutter.
This makes each file only be read at most once.
Trying it out in
packages/flutterbefore this PR I got this:With this PR I instead get this:
I.e. from ~828 seconds to ~617 seconds, or a ~25% reduction in time spent (testing without coverage takes ~236 seconds so the overhead of
--coveragein this case goes from ~592 seconds to ~381 seconds, or a ~35% reduction).