Skip to content

Eliminate enumerator boxing in TransactionNameGroups - #2801

Merged
stevejgordon merged 1 commit into
mainfrom
transactionnamegroups-optimisation
Sep 1, 2026
Merged

stevejgordon merged 1 commit into
mainfrom
transactionnamegroups-optimisation

Conversation

@stevejgordon

Copy link
Copy Markdown
Contributor

Optimises the AnyMatch / IsAnyMatch methods in WildcardMatcher by:

  • Widening the parameter type from IReadOnlyList<WildcardMatcher> to IReadOnlyCollection<WildcardMatcher>, allowing callers that hold IReadOnlyCollection (e.g. TransactionNameGroups) to pass the collection directly without an allocation or cast.
  • Fast-pathing the iteration: when the collection is already an IReadOnlyList, the inner loop uses index-based access (list[i]) instead of the enumerator, avoiding the heap-allocated IEnumerator and its virtual MoveNext/Current calls on every iteration.

The enumerator path is retained as a fallback for non-list collections.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@stevejgordon
stevejgordon requested a review from a team September 1, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants