[efficiency-improver] Monthly Activity 2026-09
- Dominant language
- C#
- Stars
- 1k
- Forks
- 312
- Avg merge
- 8h 30m
- Merged PRs (30d)
- 469
Description
## Activity for September 2026
## Suggested Actions for Maintainer
* [ ] **Review PR**: "Single-pass min/max for Azure DevOps result date aggregation" (branch `efficiency/azuredevops-single-pass-min-max`, created this run) - [Pulls](https://github.com/microsoft/testfx/pulls?q=is:pr+head:efficiency%2Fazuredevops-single-pass-min-max)
## Energy Efficiency Backlog
| Priority | Focus Area | Opportunity | Estimated Impact |
|----------|------------|-------------|------------------|
| LOW | Code-Level | `TestExecutionManager` MethodLevel parallel array-per-test in setup | One-time setup cost |
| LOW | Code-Level | `TestContextImplementation.SanitizeName`: `Array.IndexOf` per char | Only on first TestTempDirectory access |
| LOW-MEDIUM | Code-Level | `RuntimeRegistrationEmitter.EmitResolveMethodHelper`/`ResolveProperty` (source generator): O(N×M) linear scan per test method at module-init | One-time per-assembly startup cost, not a hot loop |
| LOW | Code-Level | `VideoProduction.cs` `ProducePerTestVideosAsync` O(tests×segments) overlap scan | Runs once at end-of-run (cold path) |
| LOW | Test Infra | `test/Utilities/Microsoft.Testing.TestInfrastructure`: regex-on-error-retry, tiny-collection LINQ | Cold/low-frequency, negligible scale |
| LOW | Code-Level | `MSTestTelemetryDataCollector.SerializeCollection`/`SerializeDictionary`: `OrderBy` on telemetry flush | Once per session (cold path) |
| LOW | Code-Level | `TestClassModelBuilder` (source generator): `Where`/`GroupBy`/`Select` for duplicate-method detection | Compile-time only, not a runtime hot path |
| LOW | Code-Level | `src/Adapter/MSTest.TestAdapter`: reflection-based `GetRuntimeMethod` lookup in `TestMethodFilter` (cold, once per discovery context) | Negligible, cold path |
| LOW | Code-Level | `MSTest.TestAdapter/Extensions/TestCaseExtensions.cs` `ToUnitTestElementWithUpdatedSource`: `Traits.Any()` + `.Select()` double-enumerates Traits | Negligible — trait collections are tiny (0-3 items) |
| LOW | Infrastructure | CI output-byte-count health metric | Needs maintainer discussion |
`Assert.HasCount`/`IsEmpty`/`ContainsSingle`/`CollectionAssert.AreEquivalent`/`AreNotEquivalent` LINQ-`Count()`-fast-path family fully merged (including a maintainer follow-up dedup, PR #11363). `src/Analyzers/MSTest.Analyzers` and `.CodeFixes` remain exhaustively reviewed (2026-09-14) with no open items. `Microsoft.Testing.Extensions.AzureDevOpsReport`/`HotReload`/`HtmlReport`-merger scanned this run — found and fixed one Medium-confidence item (PR above); no other findings.
Repo continues to be actively self-optimized by maintainers/Copilot coding agent. A separate `[perf-improver]` agent (issue #10914) is also actively working this repo's performance backlog — worth cross-checking before implementing overlapping opportunities.
## Discovered Commands
| Command | Purpose |
|---------|---------|
| `./build.sh` | Full restore + build |
| `./build.sh -test` | Run unit tests |
| `./build.sh -pack` | Build + produce NuGet packages |
| `./build.sh -pack -test -integrationTest` | Full pipeline incl. acceptance tests |
| `.dotnet/dotnet build .csproj -c Debug` | Faster single-project build once `.dotnet/` SDK is bootstrapped |
| `artifacts/bin//Debug//` (run directly, after `dotnet build`) | Reliable way to run a project's unit tests in this sandbox — `dotnet test` has been observed to fail with `Win32Exception` launching the test host here |
| ` --filter "FullyQualifiedName~"` | VSTest-style filter that works on this repo's MTP-based test binaries (native `--treenode-filter` is not exposed by these projects) |
| `.dotnet/dotnet format whitespace TestFx.slnx --verify-no-changes --include ` | Format check — bare `dotnet format` fails with "multiple MSBuild solution files found"; must pass `TestFx.slnx` explicitly |
Performance runner: `test/Performance/MSTest.Performance.Runner/`. Benchmark suite: `test/Performance/MSTest.Performance.Benchmarks` (BenchmarkDotNet). Nightly timing workflow: `.github/workflows/perf-timing-nightly.yml` (Phase 1 artifact collection + Phase 2 regression detection, merged via PR #10720).
## Run History
### 2026-09-18 21:41 UTC - [Run](https://github.com/microsoft/testfx/actions/runs/35397880978)
- 🔍 Identified opportunity: `AzureDevOpsResultIdStore.GetEarliestStartedDate`/`GetLatestCompletedDate` (both `AzureDevOpsTestCaseResult` and `AzureDevOpsTestSubResult` overloads) used `Where().Min()`/`Where().Max()` LINQ chains, double-enumerating the list on every result-flush batch.
- 🔧 Created draft PR "Single-pass min/max for Azure DevOps result date aggregation" (branch `efficiency/azuredevops-single-pass-min-max`) — replaced with manual single-pass loops mirroring the existing `SumDurations` pattern.
- 📊 Measured: standalone console benchmark (2,000,000 call-pairs, net8.0 Release, `Stopwatch`+`GC.GetAllocatedBytesForCurrentThread()`): 1073.37ms/192,000,040B → 511.95ms/128,000,040B — **~2.1x faster, ~33% less allocation**.
- ✅ Verified: `./build.sh` 0 warn/err; `Microsoft.Testing.Extensions.UnitTests` (net8.0, run directly) **1839/1839 passed** (37 pre-existing skips); `AzureDevOpsLivePublishingTests`-filtered run 154/154 passed; `dotnet format whitespace --verify-no-changes` clean.
- 🔍 Confirmed maintainer PR #11363 independently deduplicated the `GetCount`/`CollectionCountHelper` follow-up debt left by the two prior efficiency-improver PRs (`efficiency/assert-count-fastpath`, `efficiency/collectionassert-equivalence-fastpath`) — no action needed.
- 💬 Re-checked #8824/#3495 — no new human activity, not re-engaged (anti-spam).
- 🌱 GSF principle applied: Hardware Efficiency (fewer CPU cycles + less GC pressure per result-flush batch); SCI (reduces Energy term for the "publish one batch of Azure DevOps test results" functional unit).
### 2026-09-17 21:51 UTC - [Run](https://github.com/microsoft/testfx/actions/runs/35277903242)
- 🔍 Confirmed both prior efficiency PRs (`efficiency/assert-count-fastpath`, `efficiency/collectionassert-equivalence-fastpath`) landed via maintainer PRs #11326/#11353.
- 🔍 Ran drift re-scans of `src/Adapter/MSTestAdapter.PlatformServices`+`MSTest.TestAdapter` and `TrxReport`/`CrashDump`/`HangDump` — both confirmed clean, no new findings, no PR created.
- 🔧 Closed duplicate monthly issue #10917 (created 2026-09-01, stale since 2026-09-02) in favor of this canonical issue.
- 💬 Re-checked #8824/#3495 — no new human activity, not re-engaged (anti-spam).
### 2026-09-16 21:44 UTC - [Run](https://github.com/microsoft/testfx/actions/runs/35153712363)
- 🔧 Created draft PR "Add ICollection(T) fast-path for CollectionAssert equivalence count checks" — **landed as maintainer PR #11353**.
- 📊 Measured: ~1.6x faster (8.1-8.4ms→5.1-5.2ms, 500K calls, `List`); 1566/1566 TestFramework.UnitTests passed.
### 2026-09-15 21:42 UTC - [Run](https://github.com/microsoft/testfx/actions/runs/35026930682)
- 🔧 Created draft PR "Avoid LINQ enumerator allocation in Assert.HasCount/IsEmpty/ContainsSingle generic overloads" — **landed as maintainer PR #11326**.
- 📊 Measured: ~3.6x faster (8.51ms→2.39ms, 500K calls); 1561/1561 TestFramework.UnitTests passed.
*(Full history of all runs prior to 2026-09-15 is retained in repo memory — condensed here to keep this issue readable.)*
## Known Process Issue (IMPORTANT)
- **Duplicate monthly issue bodies**: this issue's body has been accidentally duplicated by `update_issue` calls at least twice historically. **Always do a full clean `operation: replace` rewrite** rather than relying on partial updates, and sanity-check the fetched body for repeated `## Activity for` headers before editing.
- **ALWAYS search for `is:issue is:open in:title "Monthly Activity"` with label `area/performance` BEFORE creating a new one.** A second duplicate (#10917) was found and closed on 2026-09-17 — when a search returns >1 result, compare `created_at`/`updated_at` across ALL of them, not just the first hit.
> [!WARNING]
>
> Firewall blocked 1 domain
>
> The following domain was blocked by the firewall during workflow execution:
>
> - `southcentralus0.in.applicationinsights.azure.com`
>
> To allow these domains, add them to the `network.allowed` list in your workflow frontmatter:
>
> ```yaml
> network:
> allowed:
> - defaults
> - "southcentralus0.in.applicationinsights.azure.com"
> ```
>
> See [Network Configuration](https://github.github.com/gh-aw/reference/network/) for more information.
>
>
> 🤖 **Automated content by GitHub Copilot.** Generated by the [Efficiency Improver](https://github.com/microsoft/testfx/actions/runs/35397880978/agentic_workflow) workflow. · copilot · auto · 279.7 AIC · ⌖ 18.4 AIC · ⊞ 17.8K · [◷]( · [◷](https://github.com/search?q=repo%3Amicrosoft%2Ftestfx+is%3Aissue+%22gh-aw-workflow-call-id%3A+microsoft%2Ftestfx%2Fefficiency-improver%22&type=issues))
>
Add this agentic workflow to your repo
To install this agentic workflow, run
```
gh aw add githubnext/agentics/workflows/efficiency-improver.md@main
```
Contributor guide
Research direction
Start by reviewing the listed backlog entries, especially TestExecutionManager, TestContextImplementation.SanitizeName, RuntimeRegistrationEmitter, VideoProduction.cs, and the adapter paths, then check issue #10914 for overlap. The current Azure DevOps aggregation item already has a draft PR, while the remaining opportunities need maintainer discussion and a clearly selected scope. Use ./build.sh and the relevant unit tests to verify any approved change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- performance
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100