You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 [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
🔍 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)
🔍 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
🔍 Scanned src/Adapter/ and src/TestFramework/ for new opportunities; found TestResultMessagesSerializer using List + [.. spread] instead of direct array allocation (unlike sibling DiscoveredTestMessagesSerializer which already does it right)
🔍 Scanned DotnetTestDataConsumer.cs: found 2 extra OfType() PropertyBag walks (FileArtifactProperty + TestMetadataProperty) on top of existing GetStructEnumerator pass
🔍 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)
🤖 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
Activity for June 2026
Suggested Actions for Maintainer
DerivesFrom()interface check — replacesOfType<ITypeSymbol>()+ optionalSelect()+Contains()with a directforeachoverImmutableArray<INamedTypeSymbol>(struct enumerator, zero heap allocation). Called viaInherits()36+ times per symbol analysis pass. - ReviewITestFilter— ClassInit waste quantification,TestFilterContextdesign note, measurement suggestion, GSF Demand Shaping reference. - View(Previous efficiency PRs #8692–#9436 are all merged — nothing else pending.)
Energy Efficiency Backlog
Properties.OfType<TestNodeStateProperty>().FirstOrDefault()→SingleOrDefault<TestNodeStateProperty>()Properties.OfType<TestMetadataProperty>()inyielditerator method — needs refactor to use non-iterator helperTerminalTestReporter.cs:68—TotalTestsproperty calls_assemblies.Values.Sum()on every access; callers are rareToolsTestHost.cs:55—GroupBy().Where(Count()>1)at startup onlyDiscovered Commands
./build.sh./build.sh -test./build.sh -pack./build.sh -pack -test -integrationTestNotes:
.dotnet/dotnet(Arcade-provisioned; do not use/usr/bin/dotnetfor SDK commands)--no-restoreflag is broken (unknown MSBuild switch); always run with full restoreRun History
2026-06-26 22:03 UTC - Run
efficiency/direct-array-alloc-remaining-ipc-serializers: direct-allocate arrays in IPCCommandLineOptionMessagesandFileArtifactMessages) — IPC serializer series completesrc/Analyzers/MSTest.Analyzers/for hot-path inefficiencies; foundDerivesFrom()inITypeSymbolExtensions.csusingOfType<ITypeSymbol>()+ optionalSelect()+Contains()LINQ chain — each operator allocates a heap iterator state machine; called ~36+ times per symbol analysis passDerivesFrom()— replace 1–2 heap iterators per call with directforeachoverImmutableArray<INamedTypeSymbol>(struct enumerator)ImmutableArray<T>struct enumerator avoids all iterator state-machine allocations2026-06-25 22:11 UTC - Run
efficiency/direct-array-alloc-ipc-serializer: direct-allocate arrays inTestResultMessagesSerializer)CommandLineOptionMessagesSerializerandFileArtifactMessagesSerializerstill usingList+[.. spread]pattern;TestInProgressMessagesSerializerwas already correct;TestSessionEventSerializerhas no lists;HandshakeMessageSerializerusesDictionaryCommandLineOptionMessagesandFileArtifactMessagesdeserializers — completes the IPC serializer series (all 6 serializers now use directT[length]allocation)Listbacking-array reallocations) + SCI (fewer allocations perdotnet testrun)2026-06-24 22:04 UTC - Run
efficiency/single-pass-dotnet-test-consumer: single-pass PropertyBag collection inDotnetTestDataConsumer)src/Adapter/andsrc/TestFramework/for new opportunities; foundTestResultMessagesSerializerusingList+[.. spread]instead of direct array allocation (unlike siblingDiscoveredTestMessagesSerializerwhich already does it right)TestResultMessagesSerializer— 3Listallocations + 3[.. list]spreads → 3 pre-sized direct arraysITestFilter): energy framing, ClassInit waste quantification, GSF Demand Shaping referencedotnet testrun) + Demand Shaping (LLM output volume reduction)2026-06-23 UTC - Run
efficiency/single-pass-summary-aggregation: single-pass LINQ aggregation inAppendTestRunSummary)DotnetTestDataConsumer.cs: found 2 extraOfType()PropertyBag walks (FileArtifactProperty + TestMetadataProperty) on top of existing GetStructEnumerator pass2026-06-22 22:21 UTC - Run
efficiency/fix-parseoption-hot-loopsbranch was never pushed;CommandLineParseResult.csalready has the optimized code in mainAppendTestRunSummary(TerminalTestReporter.Summary.cs)efficiency/single-pass-summary-aggregation): replace 7 separate LINQ calls (Sum×5, Any×1, Count×1) with singleforeach— saves 6 extra passes + 6 LINQ enumerator allocations per end-of-run summary renderEarlier runs (2026-06-15 to 2026-06-21)
Earlier runs (2026-06-01 to 2026-06-14)
Add this agentic workflows to your repo
To install this agentic workflow, run