Compact Protocol improvement: combine sequence of multiple STOP fields together
-------------------------------------------------------------------------------
Key: THRIFT-704
URL: https://issues.apache.org/jira/browse/THRIFT-704
Project: Thrift
Issue Type: Improvement
Affects Versions: 0.2
Reporter: Bryan Duxbury
Assignee: Bryan Duxbury
Fix For: 0.3
One thing I've noticed looking at some of our compact-protocol-serialized
structs is that we often have a sequence of STOP markers at the end of the
stream. This occurs when you have a relatively deep object tree - once you are
done serializing the last "leaf" object, you will write out a number of STOP
fields equal to the height of the tree. Strictly speaking, there will be
benefit found in the last leaf node of every subtree, not just the last leaf
node of the entire tree.
It should be possible to compress these STOPs together by packing a count into
a single STOP. Then, when reading, the protocol can sort of pre-buffer the
correct number of STOPs. These changes would leave the protocol implementation
backwards compatible from the reading perspective, but not from the writing
perspective. As such, I would probably add a flag to enable and disable this
behavior when writing.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.