Skip to content

Conversation

webmakersteve
Copy link

@webmakersteve webmakersteve commented Mar 23, 2022

Adjusts the primary serializer interface to return an ArraySegment-wrapped byte array in favor of the byte array itself. It then uses the resulting count and offset fields to be passed into the produce call. The new interface also supports a Release hook which can be used after the produce call has happened.

The primary use case is to allow for pooled arrays to be written to, or recycled streams' internal buffers. This helps a lot when writing data greater than 85K which would ordinary require LOH allocations and greatly impact the performance of the service.

I made the adjustment so there should be no breaking changes - the builder interfaces just "upgrade" the old variant serializers by wrapping them. The producer class internally uses the new interfaces only. The release methods are no-op on the wrapped serializers.

This may provide very similar functionality to #1725 without an API break

@yinzara
Copy link
Contributor

yinzara commented Jun 21, 2022

Just noting I am not an official collaborator, just reading your issue and PR.

This adds capabilities without modifying any of the existing serializers to take advantage of this capability. I'd love to see how this would change the AvroSerializer or ProtobufSerializer etc to now be more efficient or better.

@cla-assistant
Copy link

cla-assistant bot commented Aug 7, 2023

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Stephen Parente seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

3 participants