Skip to content

[efficiency-improver] Monthly Activity 2026-09 #11023

Description

@github-actions

Activity for September 2026

Suggested Actions for Maintainer

  • Review PR: "[efficiency-improver] perf: single-pass Traits conversion in TestCaseExtensions" (branch efficiency/testcase-traits-single-enumeration, created this run) - Pulls

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 Infrastructure CI output-byte-count health metric Needs maintainer discussion

TestCaseExtensions.ToUnitTestElementWithUpdatedSource's Traits double-enumeration (last item in the table above) fixed this run — see PR above. Assert.HasCount/IsEmpty/ContainsSingle/CollectionAssert.AreEquivalent/AreNotEquivalent LINQ-Count()-fast-path family fully merged (incl. maintainer dedup PR #11363). src/Analyzers/MSTest.Analyzers/.CodeFixes exhaustively reviewed (2026-09-14), no open items. AzureDevOpsResultIdStore min/max single-pass fix confirmed present in main this run (resolves the multi-run "was it actually created?" saga from 2026-09-18/19/20 — the fix is real and landed).

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 <project>.csproj -c Debug Faster single-project build once .dotnet/ SDK is bootstrapped
artifacts/bin/<Project>/Debug/<tfm>/<Assembly> (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
<binary> --filter "FullyQualifiedName~<name>" VSTest-style filter that works on this repo's MTP-based test binaries
.dotnet/dotnet format whitespace TestFx.slnx --verify-no-changes --include <file> Format check — bare dotnet format fails with "multiple MSBuild solution files found"; must pass TestFx.slnx explicitly
⚠️ Do NOT dotnet restore <proj>.csproj -p:TargetFrameworks=net8.0 or /p:TargetFramework=net8.0 as a workaround for missing net462/net48 SDKs on shared multi-project builds — it corrupts sibling projects' project.assets.json (removes other TFM targets), breaking unrelated builds until a full ./build.sh re-restore. Confirmed 2026-09-21.
MSTestAdapter.UnitTests / MSTestAdapter.PlatformServices.UnitTests (both multi-target net462;net48;net8.0;net9.0) cannot be restored/built/run in this sandbox at all — no .NET Framework SDK, and both are excluded from NonWindowsTests.slnf. Verify changes to src/Adapter/* via the full ./build.sh compile only; note the gap in PR "Test Status".

Performance runner: test/Performance/MSTest.Performance.Runner/. Benchmark suite: test/Performance/MSTest.Performance.Benchmarks (BenchmarkDotNet). Nightly timing workflow: .github/workflows/perf-timing-nightly.yml.

Run History

2026-09-21 21:43 UTC - Run

  • 🔍 Verified the AzureDevOpsResultIdStore min/max single-pass fix (previously reported as uncertain across 3 prior runs) IS present in main — confirmed via get_file_contents that both GetDateRange helpers already use manual single-pass loops, no Where().Min()/Max(). Closes out that multi-run "false log" saga.
  • 🔍 Ran a background scan of src/Adapter/MSTestAdapter.PlatformServices/MSTest.TestAdapter — 0 new findings beyond the already-known LOW-priority TestCaseExtensions.cs Traits double-enumeration.
  • 🔧 Fixed TestCaseExtensions.ToUnitTestElementWithUpdatedSource's Traits.Any()+Traits.Select() double-enumeration with a single-pass foreach + lazily-allocated list. First attempt (materialize array, then check Length > 0) actually regressed the empty-traits case (always allocates); iterated to a lazy-list version that matches old allocation for empty traits and is ~2x faster/~20% less alloc for populated traits.
  • 📊 Measured: standalone console micro-benchmark (2,000,000 iterations, net8.0 Release): empty-traits 64ms/40B (old) vs 85ms/40B (new, comparable); 2-traits 275ms/560,000,040B (old) vs 140ms/448,000,040B (new) — ~2x faster, ~20% less allocation for the populated case.
  • ✅ Verified: ./build.sh (full repo) 0 warn/err; dotnet format whitespace --verify-no-changes clean. Could not run MSTestAdapter.PlatformServices.UnitTests/MSTestAdapter.UnitTests (net462/net48 SDK unavailable, both excluded from NonWindowsTests.slnf) — documented as a Test Status gap in the PR.
  • 🔧 Created draft PR "single-pass Traits conversion in TestCaseExtensions" (branch efficiency/testcase-traits-single-enumeration).
  • 💬 Re-checked [RFC] Agent/LLM-efficient test output for Microsoft.Testing.Platform #8824/Show slowest tests #3495 — no new human activity, not re-engaged (anti-spam holds). No new efficiency/performance-labeled issues found.
  • 🌱 GSF principle applied: Hardware Efficiency (removes a redundant enumeration pass per discovered test case); SCI (reduces Energy term for the "convert TestCase to UnitTestElement" functional unit).
  • ⚠️ Process note added to Discovered Commands: partial-TFM dotnet restore -p:TargetFramework(s)=net8.0 workarounds corrupt sibling projects' restore state in this sandbox — always re-run full ./build.sh to recover, and avoid this workaround pattern for future net462/net48-only-project builds.

2026-09-20 21:56 UTC - Run

(Full history of all runs prior to 2026-09-20 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. When a search returns >1 result, compare created_at/updated_at across ALL of them, not just the first hit, and close duplicates.
  • Sandbox restore workaround pitfall (NEW, 2026-09-21): using dotnet restore <proj> -p:TargetFramework(s)=net8.0 to work around missing net462/net48 SDKs corrupts other projects' project.assets.json (drops their other TFM targets from the assets file), breaking builds repo-wide until a full ./build.sh re-restore. Do not use this pattern; if a project truly cannot be restored (net462/net48-only test projects), just skip running its tests and note the gap in the PR's Test Status section instead.

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • github.com
  • southcentralus0.in.applicationinsights.azure.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"
    - "southcentralus0.in.applicationinsights.azure.com"

See Network Configuration for more information.

🤖 Automated content by GitHub Copilot. Generated by the Efficiency Improver workflow. · copilot · auto · 440.4 AIC · ⌖ 11.6 AIC · ⊞ 17.8K · [◷]( · )

Add this agentic workflow to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/efficiency-improver.md@main

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/performanceRuntime / build performance / efficiency.type/automationCreated or maintained by an agentic workflow.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions