Repository navigation
[Dreaming] dreaming: flag System.Reflection on hot paths in expert-reviewer checklist - #14372
Merged
baronfel merged 1 commit intoJul 15, 2026
Conversation
…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]>
baronfel
approved these changes
Jul 15, 2026
baronfel
left a comment
Member
There was a problem hiding this comment.
Seems like a reasonable guideline 👍
baronfel
deleted the
dreaming/2026-07-15-reflection-hot-path-68294dc053323d79
branch
July 15, 2026 15:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 whenSystem.Reflection(constructor discovery,Activator,MethodInfolookups) 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 viaEnsureConstructorsResolved/GetResolvedConstructorThis 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, butSystem.Reflectionon 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:
awmgmcpgSee Network Configuration for more information.