[ 
https://issues.apache.org/jira/browse/THRIFT-110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12638086#action_12638086
 ] 

Bryan Duxbury commented on THRIFT-110:
--------------------------------------

There's two ways to go with this. The first way is to keep the interface the 
same and make the protocol itself stateful. In this scenario, when you call 
writeFieldBegin(), rather than immediately writing to the transport, the 
protocol will buffer the fact that you said it's going to be an int, and once 
you actually write said integer, it will then write the field information along 
with the modifier and value. 

The preferable approach would be to change the TProtocol interface to write 
fields along with their values all at once. This would make implementing the 
described protocol much simpler, but would obviously necessitate changing all 
the existing protocols. As such, it doesn't seem likely that people will accept 
that change, so I'm going to go with the stateful approach for now. If I'm 
wrong, and we would actually consider changing the protocol interface, I'm glad 
to open a separate issue to that effect.

> A more compact format 
> ----------------------
>
>                 Key: THRIFT-110
>                 URL: https://issues.apache.org/jira/browse/THRIFT-110
>             Project: Thrift
>          Issue Type: Improvement
>            Reporter: Noble Paul
>         Attachments: compact_proto_spec.txt, compact_proto_spec.txt
>
>
> Thrift is not very compact in writing out data as (say protobuf) . It does 
> not have the concept of variable length integers and various other 
> optimizations possible . In Solr we use a lot of such optimizations to make a 
> very compact payload. Thrift has a lot common with that format.
> It is all done in a single class
> http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/common/util/NamedListCodec.java?revision=685640&view=markup
> The other optimizations include writing type/value  in same byte, very fast 
> writes of Strings, externalizable strings etc 
> We could use a thrift format for non-java clients and I would like to see it 
> as compact as the current java version

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to