-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Event Hubs] Minor Performance Tweaks #26983
Merged
Merged
Conversation
This file contains 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
The focus of these changes is to apply some of the performance-oriented tweaks made in Service Bus to the Event Hubs clients. Included are: - Attempt to retrieve AMQP objects synchronously before calling `GetOrCreateAsync` - Remove LINQ from the `AmqpMessageConverter` - Change the internal batch `AsEnumerable<T>` to `AsList<T>` in order to avoid casting costs and have `Count` available to right-size transform collections. - Use the two item overload when creating a linked token source to avoid allocating an unnecessary array. _([ref](https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Threading/CancellationTokenSource.cs#L736-L739))_
jsquire
added
Event Hubs
Client
This issue points to a problem in the data-plane of the library.
labels
Feb 12, 2022
@danielmarbach: I'd appreciate any thoughts and feedback that you may have. |
/azp run net - eventhub - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
jsquire
commented
Feb 12, 2022
sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpMessageConverter.cs
Outdated
Show resolved
Hide resolved
jsquire
commented
Feb 12, 2022
sdk/eventhub/Azure.Messaging.EventHubs/src/EventHubsModelFactory.cs
Outdated
Show resolved
Hide resolved
jsquire
commented
Feb 12, 2022
sdk/eventhub/Azure.Messaging.EventHubs/src/Producer/EventHubProducerClient.cs
Outdated
Show resolved
Hide resolved
JoshLove-msft
approved these changes
Feb 13, 2022
…erializing the enumerable in the public API call site
sdk/eventhub/Azure.Messaging.EventHubs/src/Producer/EventDataBatch.cs
Outdated
Show resolved
Hide resolved
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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
The focus of these changes is to apply some of the performance-oriented tweaks made in Service Bus to the Event Hubs clients. Included are:
Attempt to retrieve AMQP objects synchronously before calling
GetOrCreateAsync
Remove LINQ from the
AmqpMessageConverter
Change the internal batch
AsEnumerable<T>
toAsList<T>
in order to avoid casting costs and haveCount
available to right-size transform collections.Use the two item overload when creating a linked token source to avoid allocating an unnecessary array. (ref)
References and Resources