Repository navigation
perf: avoid rescanning test children in Test Explorer - #347176
Open
Simon Siefke (SimonSiefke) wants to merge 3 commits into
Open
Simon Siefke (SimonSiefke) wants to merge 3 commits into
Simon Siefke (SimonSiefke) wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified in the changes to cache child aggregates and improve Test Explorer performance for large suites.
No open issues 🎉
What changed in this PR
Improves Test Explorer performance for large suites by caching child aggregates instead of repeatedly scanning siblings as test results arrive.
Changes:
- Cache child state counts and update duration totals incrementally.
- Skip redundant parent recomputation while preserving result clearing and zero-duration handling.
- Add regression tests for aggregation, duration updates, and result lifecycle behavior.
| File | Description |
|---|---|
src/vs/workbench/contrib/testing/test/common/testResultService.test.ts |
Excludes the runtime cache from serialization expectations. |
src/vs/workbench/contrib/testing/test/common/getComputedState.test.ts |
Tests cached aggregation, scan counts, and duration edge cases. |
src/vs/workbench/contrib/testing/test/browser/explorerProjections/treeProjection.test.ts |
Tests redundant-update avoidance, result clearing, and duration transitions. |
src/vs/workbench/contrib/testing/common/testResult.ts |
Adds node-owned state caches to live test results. |
src/vs/workbench/contrib/testing/common/getComputedState.ts |
Implements cached state counts and incremental duration aggregation. |
src/vs/workbench/contrib/testing/browser/explorerProjections/treeProjection.ts |
Integrates caches and refines parent refresh and zero-duration handling. |
Review effort: Balanced
This branch has not been deployed
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.
This PR is related to #346656.
Details
When tests in a large suite finish, each result update scans the other tests to recompute the suite's state and total duration. Repeating these scans for thousands of tests slows down Test Explorer.
Change
Cache child state counts and update duration totals as individual tests change. This avoids repeatedly scanning the whole suite and skips redundant parent updates in Test Explorer, while preserving result clearing and zero-duration tests.
Renderer before
Renderer after
Performance
5000 Mocha tests