Re: [protobuf] Protobuf Buffers v3.0.0-alpha-1

2014-12-15 Thread Vladimir Agafonkin
Hi Feng,
 

 As far I know, protobuf wire format does not have much of an advantage 
 over JSON format on web apps because the payload is usually small enough 
 and encoding/decoding protobuf wire format with Javascript does not 
 necessarily have a better performance than the built-in JSON 
 encoder/decoder.


Protobuf has a big advantage over JSON for some web apps. In particular, 
when you are transferring big amounts of data. In our use case (client-side 
WebGL vector maps https://www.mapbox.com/blog/mapbox-gl-js/, with lots of 
numeric data on the wire), Protobuf provides about 2-3 smaller gzipped 
sizes compared to JSON. In addition, it is much faster to decode — 
`JSON.parse` parses the data all at once due to the arbitrarily nested 
nature of JSON, while with Protobuf, you can parse data sequentially, chunk 
by chunk.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] how to use protobuff in libevent?

2014-12-15 Thread 尚鹏飞


Now , I’m writing a server based on libevent. As I know libevent support a 
evbuffer to send and receive data from socket, but I don’t want to another 
copy when I put or get data from evbuffer using protobuff. How to using 
protobuff to avoid another copy? I know the io::ZeroCopyInputStream and 
io::ZeroCopyOutputStream but not know how to combine it with evbuffer. Is 
there any example ?

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.