Skip to content

[Dreaming] dreaming: flag System.Reflection on hot paths in expert-reviewer checklist - #14372

Merged
baronfel merged 1 commit into
mainfrom
dreaming/2026-07-15-reflection-hot-path-68294dc053323d79
Jul 15, 2026
Merged

baronfel merged 1 commit into
mainfrom
dreaming/2026-07-15-reflection-hot-path-68294dc053323d79

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

This PR adds one learning-atom change to the expert-reviewer agent checklist based on a recurring pattern observed in the past 7 days.

Change: .github/agents/expert-reviewer.agent.md — added checklist item (amendment)

What changed: Added a bullet to the performance dimension CHECK — Flag if: list warning reviewers when System.Reflection (constructor discovery, Activator, MethodInfo lookups) appears on hot paths without caching.

Why: PR #14315 (TaskEnvironment constructor injection) generated multiple independent reviewer comments about reflection cost on task-instantiation hot paths:

  • jankratochvilcz: "Are we comfortable doing reflection like this effectively in the constructor? It feels like an expensive operation"
  • baronfel (author): Acknowledged the concern and restructured to cache results lazily via EnsureConstructorsResolved / GetResolvedConstructor
  • Both parties agreed the fix pattern (lazy caching) was the right approach

This is 2+ independent participants raising the same pattern, with an established fix pattern.

Not already covered: Checked AGENTS.md, all .github/instructions/*.instructions.md, and .github/agents/expert-reviewer.agent.md. The existing performance checklist covers LINQ, string allocations, and cached computations generically, but System.Reflection on hot paths is not mentioned specifically. Task loading sits on the per-invocation path, making this a recurring risk area.


A human maintainer should review and merge (or adjust/drop) this change.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

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

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

Generated by Dreaming (learning atoms curation) · 52.3 AIC · ⌖ 5.71 AIC · ⊞ 6.7K · ◷

…klist

Add a checklist item to the performance dimension of expert-reviewer.agent.md
warning reviewers when reflection (constructor discovery, Activator, MethodInfo
lookups) is used on hot paths without caching.

Co-authored-by: Copilot <[email protected]>
@github-actions github-actions Bot added the Area: Documentation Issues about docs, including errors and areas we should extend (this repo and learn.microsoft.com) label Jul 15, 2026
@github-actions
github-actions Bot requested a review from a team as a code owner July 15, 2026 12:51
@github-actions github-actions Bot added the Area: Documentation Issues about docs, including errors and areas we should extend (this repo and learn.microsoft.com) label Jul 15, 2026
@jankratochvilcz
jankratochvilcz requested a review from baronfel July 15, 2026 13:17

@baronfel baronfel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a reasonable guideline 👍

@baronfel
baronfel merged commit e64d503 into main Jul 15, 2026
15 checks passed
@baronfel
baronfel deleted the dreaming/2026-07-15-reflection-hot-path-68294dc053323d79 branch July 15, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Documentation Issues about docs, including errors and areas we should extend (this repo and learn.microsoft.com)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant