Skip to content

[efficiency-improver] Monthly Activity 2026-06 #9197

Description

@Evangelink

Activity for June 2026

Suggested Actions for Maintainer

  • Review draft PR #aw_pr_derives: perf: eliminate LINQ iterator allocations in DerivesFrom() interface check — replaces OfType<ITypeSymbol>() + optional Select() + Contains() with a direct foreach over ImmutableArray<INamedTypeSymbol> (struct enumerator, zero heap allocation). Called via Inherits() 36+ times per symbol analysis pass. - Review
  • Check comment on Expose programmatic test filtering via ITestFilter (avoid ClassInit cost for filtered-out tests) #8894: Efficiency Improver added energy-efficiency framing for ITestFilter — ClassInit waste quantification, TestFilterContext design note, measurement suggestion, GSF Demand Shaping reference. - View
  • Check comment on [RFC] Agent/LLM-efficient test output for Microsoft.Testing.Platform #8824: Efficiency Improver added energy impact prioritisation for LLM-output RFC proposals — ordered by token reduction, stack-frame filtering highlighted as highest win, suggestion to track output byte count as CI health metric. - View

(Previous efficiency PRs #8692#9436 are all merged — nothing else pending.)

Energy Efficiency Backlog

Priority Focus Area Opportunity Estimated Impact
MEDIUM Infrastructure Assess benchmark coverage for IPC/reporter serializer paths; propose benchmarks if absent Enables future regression detection
LOW Code-Level VideoRecorder: Properties.OfType<TestNodeStateProperty>().FirstOrDefault()SingleOrDefault<TestNodeStateProperty>() Rarely-used extension, minor
LOW Code-Level OpenTelemetry: Properties.OfType<TestMetadataProperty>() in yield iterator method — needs refactor to use non-iterator helper Minor
LOW Code-Level TerminalTestReporter.cs:68TotalTests property calls _assemblies.Values.Sum() on every access; callers are rare Negligible
LOW Code-Level ToolsTestHost.cs:55GroupBy().Where(Count()>1) at startup only Negligible

Discovered Commands

Command Purpose Validated
./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

Notes:

  • Local SDK: .dotnet/dotnet (Arcade-provisioned; do not use /usr/bin/dotnet for SDK commands)
  • --no-restore flag is broken (unknown MSBuild switch); always run with full restore
  • MSTestAdapter internal-framework tests are not run by the MTP runner; CI covers them separately

Run History

2026-06-26 22:03 UTC - Run

  • ✅ Confirmed PR [efficiency-improver] perf: direct-allocate arrays in IPC CommandLineOption and FileArtifact deserializers #9436 merged (efficiency/direct-array-alloc-remaining-ipc-serializers: direct-allocate arrays in IPC CommandLineOptionMessages and FileArtifactMessages) — IPC serializer series complete
  • 🔍 Scanned src/Analyzers/MSTest.Analyzers/ for hot-path inefficiencies; found DerivesFrom() in ITypeSymbolExtensions.cs using OfType<ITypeSymbol>() + optional Select() + Contains() LINQ chain — each operator allocates a heap iterator state machine; called ~36+ times per symbol analysis pass
  • 🔧 Submitted draft PR #aw_pr_derives: eliminate LINQ iterator allocations in DerivesFrom() — replace 1–2 heap iterators per call with direct foreach over ImmutableArray<INamedTypeSymbol> (struct enumerator)
  • 📊 Proxy metric: managed heap allocation count per Roslyn analyzer invocation; ImmutableArray<T> struct enumerator avoids all iterator state-machine allocations
  • 🌱 GSF principle: Hardware Efficiency (struct enumerator → fewer virtual dispatch calls) + SCI (fewer allocations per analysis pass across millions of MSTest projects in the .NET ecosystem)

2026-06-25 22:11 UTC - Run

  • ✅ Confirmed PR [efficiency-improver] perf: direct-allocate arrays in IPC TestResultMessages deserializer #9408 merged (efficiency/direct-array-alloc-ipc-serializer: direct-allocate arrays in TestResultMessagesSerializer)
  • 🔍 Scanned all remaining IPC serializers; found CommandLineOptionMessagesSerializer and FileArtifactMessagesSerializer still using List + [.. spread] pattern; TestInProgressMessagesSerializer was already correct; TestSessionEventSerializer has no lists; HandshakeMessageSerializer uses Dictionary
  • 🔧 Submitted draft PR [efficiency-improver] perf: direct-allocate arrays in IPC CommandLineOption and FileArtifact deserializers #9436: direct-allocate arrays in CommandLineOptionMessages and FileArtifactMessages deserializers — completes the IPC serializer series (all 6 serializers now use direct T[length] allocation)
  • 📊 Proxy metric: managed allocation count + O(N) array-copy operations eliminated per IPC session
  • 🌱 GSF principle: Hardware Efficiency (pre-sized arrays avoid List backing-array reallocations) + SCI (fewer allocations per dotnet test run)

2026-06-24 22:04 UTC - Run

2026-06-23 UTC - Run

  • ✅ Confirmed PR [efficiency-improver] perf: single-pass aggregation in AppendTestRunSummary #9353 merged (efficiency/single-pass-summary-aggregation: single-pass LINQ aggregation in AppendTestRunSummary)
  • 🔍 Scanned DotnetTestDataConsumer.cs: found 2 extra OfType() PropertyBag walks (FileArtifactProperty + TestMetadataProperty) on top of existing GetStructEnumerator pass
  • 🔧 Submitted draft PR [efficiency-improver] perf: single-pass PropertyBag collection in DotnetTestDataConsumer #9380: consolidate FileArtifactProperty and TestMetadataProperty into existing single-pass GetStructEnumerator walk — eliminates 50–67% of PropertyBag iterations per test in dotnet-test server mode
  • 📊 Proxy metric: PropertyBag linked-list iteration count (2–3× passes → 1× per test update)
  • 🌱 GSF principle: Hardware Efficiency — fewer memory dereferences per test = lower instruction count

2026-06-22 22:21 UTC - Run

  • 🔍 Task 4: Verified no open efficiency-improver PRs — previous efficiency/fix-parseoption-hot-loops branch was never pushed; CommandLineParseResult.cs already has the optimized code in main
  • 🔍 Task 2: Scanned for new opportunities; confirmed PropertyBag hot-paths fully optimized across all report extensions; found 7-pass LINQ aggregation in AppendTestRunSummary (TerminalTestReporter.Summary.cs)
  • 🔧 Submitted draft PR [efficiency-improver] perf: single-pass aggregation in AppendTestRunSummary #9353 (efficiency/single-pass-summary-aggregation): replace 7 separate LINQ calls (Sum×5, Any×1, Count×1) with single foreach — saves 6 extra passes + 6 LINQ enumerator allocations per end-of-run summary render
  • 📊 Proxy metric: LINQ enumerator allocation count + iteration count at test-run end
  • 🌱 GSF principle: Hardware Efficiency — fewer managed allocations per run reduces GC pressure

Earlier runs (2026-06-15 to 2026-06-21)

Earlier runs (2026-06-01 to 2026-06-14)

🤖 Automated content by GitHub Copilot. Posted via a maintainer's GitHub token, so it appears under their account — the account owner did not write or approve this content personally. Generated by the Efficiency Improver workflow. · 1.5K AIC · ⌖ 39.6 AIC · ⊞ 58.8K · [◷]( · )

Add this agentic workflows to your repo

To install this agentic workflow, run

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

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions