Thrift is a streaming serialization format. See also Protocol Buffers and Avro.
Thrift::XS provides faster versions of Thrift::BinaryProtocol and Thrift::MemoryBuffer. On average it is about 4-6 times faster.
Thrift compact protocol support is also available, just replace Thrift::XS::BinaryProtocol with Thrift::XS::CompactProtocol.
To use, simply replace your Thrift initialization code with the appropriate Thrift::XS version.