proto3 java zero copy

546 views
Skip to first unread message

Noam Schachter

unread,
May 23, 2016, 12:54:11 AM5/23/16
to Protocol Buffers
Hi,

I saw in the release notes that the proto-3 beta3 adds a zero copy serialization to the java API.
Does zero copy mean it will be possible to pool and reuse generated messages? or does it only refer to serializing generated messages to output streams? 
Is there an example or documentation to zero copy serialization ?

Thanks,
Noam


Feng Xiao

unread,
May 23, 2016, 12:55:58 AM5/23/16
to Noam Schachter, Nathan Mittler, Protocol Buffers
+Nathan
 

Thanks,
Noam


--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Nathan Mittler

unread,
May 23, 2016, 10:20:26 AM5/23/16
to Feng Xiao, Noam Schachter, Protocol Buffers
On Sun, May 22, 2016 at 9:55 PM, Feng Xiao <xiao...@google.com> wrote:


On Sat, May 21, 2016 at 11:47 PM, Noam Schachter <sch....@gmail.com> wrote:
Hi,

I saw in the release notes that the proto-3 beta3 adds a zero copy serialization to the java API.
Does zero copy mean it will be possible to pool and reuse generated messages? or does it only refer to serializing generated messages to output streams? 
Is there an example or documentation to zero copy serialization ?
+Nathan
 

"zero copy" refers the the ability to serialize large ByteString fields without requiring that CodedOutputStream first copy the contents.  There is a new experimental API "ByteOutput" which can be the target of a COS and has semantics for identifying when the received bytes are read-only (i.e. references to internals of a ByteString) and therefore need not be copied.  The application would then have to rope together the chunks that are output by COS before forwarding to the transport.

We don't yet have any examples on github, but grpc is planning on taking advantage of this in the near future ... stay tuned.

Stefano Baghino

unread,
Oct 27, 2020, 5:07:47 AM10/27/20
to Protocol Buffers
Is there any update on this?
Reply all
Reply to author
Forward
0 new messages