Cache plugin registrant in test compiler#185598
Merged
auto-submit[bot] merged 1 commit intoMay 5, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request modifies TestCompiler to cache the generated plugin registrant, only regenerating it when the language version of the test entrypoint changes. It adds a _registrantLanguageVersion field and updates the compilation logic to check for version mismatches. New tests verify the reuse and regeneration behavior. Feedback suggests removing an unnecessary null-check operator on Cache.flutterRoot.
bkonyi
previously approved these changes
May 4, 2026
chingjun
previously approved these changes
May 4, 2026
73572c9 to
dc4d88e
Compare
Contributor
Author
|
Fixed linting and rebased on newest master. |
chingjun
approved these changes
May 5, 2026
bkonyi
approved these changes
May 5, 2026
This was referenced May 6, 2026
This was referenced May 7, 2026
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.
Towards #69429 ("Make
flutter testfaster").This change makes
TestCompilercache the plugin registrant insteadof regenerating it for each test file. Plugins are stable for the lifetime of a single
flutter testrun. However, the Dart version of test files might differ, so the cache is keyed on the test file's
Dart version.
Benchmark
Flutter foundation test suite (32 files, 220 tests),
flutter test -j 4, 3 runs + 1 warmup:That means the startup time for
flutter testis reduced by ~13ms per test file on my machine. That quickly adds up and significantly improves Flutter's TDD experience.Results were generated with the following script:
Benchmark
Pre-launch Checklist
///).