Azure / azure-amqp

AMQP C# library
Other
94 stars 70 forks source link

High allocations due to AmqpMap enumerations #246

Closed Stabzs closed 9 months ago

Stabzs commented 1 year ago

Currently, when sending batches over Event Hub, a large number of allocations are generated due to AmqpMap holding an IDictionary<TKey, TValue> reference instead of a concrete Dictionary. For 90k event hub events, over 70 megabytes of Dictionary+Enumerator<MapKey, Object> allocations were created, which is extremely substantial and currently is the third-highest source of allocations in my application.

This appears to be fixed in master by having AmqpMap inherit from Dictionary. Are there plans on publishing the master changes soon? There are a large number of performance issues with the current version of the library (2.6.2) and it is unclear if PRs to patch them would be welcomed or if there is a timeline for 3.0.0. As is, a tremendous amount of allocations are generated in a number of Azure Amqp paths beyond just Enumerators.

Much appreciated for any guidance.

xinchen10 commented 1 year ago

3.0.0 has major breaking changes and it will take some time to further review the public APIs, so that we can avoid breaking changes later. There is no planned date for its release currently. We will continue using the hotfix branch (2.x) for bug fixes and performance improvements. PRs are very welcome. The only restriction is that we cannot take breaking changes in 2.x.

Stabzs commented 1 year ago

This makes sense, thanks for the transparency. I'm happy to help with any PRs to hotfix on issues I identify, keeping the public api intact.

Stabzs commented 1 year ago

@xinchen10 will there be a new version with this change any time soon? This continues to be a significant hot spot for me.

xinchen10 commented 1 year ago

Released 2.6.3.