Repository navigation
Eliminate enumerator boxing in TransactionNameGroups - #2800
Closed
stevejgordon wants to merge 1 commit into
Closed
stevejgordon wants to merge 1 commit into
stevejgordon wants to merge 1 commit into
Conversation
|
💚 CLA has been signed |
🤖 GitHub commentsJust comment with:
|
stevejgordon
force-pushed
the
transactionnamegroups-optimisation
branch
from
September 1, 2026 15:40
f99f1bc to
f900b48
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The optimization introduces a source- and binary-breaking change to the public configuration interface.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Optimizes transaction-name grouping by enabling indexed matcher access to avoid enumerator boxing.
Changes:
- Changes transaction-name-group collections to
IReadOnlyList. - Replaces matcher enumeration with indexed iteration.
File summaries
| File | Description |
|---|---|
test/Elastic.Apm.Tests/ConstructorTests.cs |
Updates test configuration signature. |
test/Elastic.Apm.Feature.Tests/TestConfiguration.cs |
Updates feature-test configuration signature. |
src/Elastic.Apm/Helpers/WildcardMatcher.cs |
Uses indexed matching. |
src/Elastic.Apm/Config/IConfigurationReader.cs |
Changes the public configuration contract. |
src/Elastic.Apm/Config/FallbackToEnvironmentConfigurationBase.cs |
Updates stored collection type. |
src/Elastic.Apm/Config/ConfigConsts.cs |
Updates the default value type. |
src/Elastic.Apm/Config/AbstractConfigurationReader.cs |
Updates parser return type. |
src/Elastic.Apm/BackendComm/CentralConfig/RuntimeConfigurationSnapshot.cs |
Updates snapshot property type. |
src/Elastic.Apm/BackendComm/CentralConfig/CentralConfiguration.cs |
Updates central configuration type. |
Review details
- Files reviewed: 9/9 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| /// </para> | ||
| /// </remarks> | ||
| IReadOnlyCollection<WildcardMatcher> TransactionNameGroups { get; } | ||
| IReadOnlyList<WildcardMatcher> TransactionNameGroups { get; } |
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.
Follow-up to #2791, which introduced a
forloop inAnyMatchbut left the parameter typed asIReadOnlyCollection<WildcardMatcher>. Because the compiler must callIEnumerable<T>.GetEnumerator()through the interface, it boxes the underlying struct enumerator into a heap allocation on every invocation.This change widens
TransactionNameGroupsfromIReadOnlyCollectiontoIReadOnlyList(consistent withSanitizeFieldNames,TransactionIgnoreUrls, andIgnoreMessageQueues).ReadOnlyCollection<T>already implementsIReadOnlyList<T>, so all existing implementations and call sites are unaffected.