Skip to content
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

[csharp] [discussion] Buffer allocation considerations - Marshaller-T #19447

Closed
mgravell opened this issue Jun 23, 2019 · 7 comments
Closed

[csharp] [discussion] Buffer allocation considerations - Marshaller-T #19447

mgravell opened this issue Jun 23, 2019 · 7 comments
Labels

Comments

@mgravell
Copy link
Contributor

mgravell commented Jun 23, 2019

I'm looking at the gRPC implementation with a view to .NET performance, and it is of keen note that the Marshaller<T> API is very much focused around "allocate a buffer per job". It looks like there was some interest in ReadOnlySequence<byte>, but that this has now petered out (as far as I can see it is neither implemented nor consumed).

Would there be any interest in trying to resurrect this topic? I'm happy to offer some input here, but I don't want to bore people with that if this is a "done and done" dead topic. For context, I have lots of experience with all of the current memory APIs and how to use them to optimize memory throughput in high volume systems, including extensive knowledge of pipelines (ROS-T), buffers (Memory-T, Span-T), the array pool, etc. I'm also intimately familiar with protobuf and the impact on serializers.

Reading between the lines, I'm guessing (on a hunch) that the ROS-T work was deemed not worth the trouble for the serializer, but if that's the case there may still be scope for large gains by using the array-pool or buffer-pool, with minimal API changes or serializer changes.

So: let me know if my input would be useful here. Also let me know if it wouldn't! Thanks.

@mgravell mgravell changed the title [csharp] [discussion] Buffer allocation considerations [csharp] [discussion] Buffer allocation considerations - Marshaller-T Jun 23, 2019
@jtattermusch
Copy link
Contributor

jtattermusch commented Jun 24, 2019 via email

@jtattermusch
Copy link
Contributor

protocolbuffers/protobuf#5888 is currently deprioritized because of feature work on grpc-dotnet, but we do plan to get back to it. If you wanted to take a look at it in the meantime, you're welcome to do so.

@mgravell
Copy link
Contributor Author

That's encouraging - I couldn't see what is implementing the zero-copy non-contiguous variant (ROS-byte) but I'll take a deeper look, especially since it sounds like you're open to input. I didn't want to dive in too deep without checking the water, so to speak!

@jtattermusch
Copy link
Contributor

@mgravell see this PR #18865 for details.

Just to set the expectations - performance work is not the priority right now, but that said, we're happy to have conversations about future designs and accept contributions with perf improvements.

@mgravell
Copy link
Contributor Author

Just to set the expectations

That's fine - it means I can do some thinking and make some suggestions (I like to talk before coding) without trampling on any else's toes or risking a merge conflict, and the project might get some free perf gains without distracting the core team from their current priorities.

@mgravell
Copy link
Contributor Author

@jtattermusch I've started my initial dabblings here; marked "draft" at the moment as I'm still having difficulty with the Windows build, so it isn't fully tested yet etc; just wanted to highlight the ideas I had in mind

@mgravell
Copy link
Contributor Author

mgravell commented Jul 1, 2019

(closing; moving to discreet issues)

@mgravell mgravell closed this as completed Jul 1, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Sep 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants