Skip to content


Subversion checkout URL

You can clone with
Download ZIP


wish: Consider use thrift-xs #1

jcbf opened this Issue · 1 comment

2 participants


Andy Grundman's Thrift-XS is a drop-in replacement for Thrift module.

Thrift::XS provides faster versions of Thrift::BinaryProtocol and Thrift::MemoryBuffer.
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.

Check please or
Could do something similar with JSON module and allow the developer to specify with backend or load XS and fallback to PurePerl

Benchmarks shows significant improvment

XS::MemoryBuffer write + read: 6x faster

    writeMessageBegin + readMessageBegin: 12.0x
    complex struct/field write+read:       6.6x
    writeMapBegin + readMapBegin:         24.0x
    writeListBegin + readListBegin:       20.0x
    writeSetBegin + readSetBegin:         21.0x
    writeBool + readBool:                 13.5x
    writeByte + readByte:                 13.9x
    writeI16 + readI16:                   14.4x
    writeI32 + readI32:                   12.9x
    writeI64 + readI64:                   29.4x
    writeDouble + readDouble:             13.5x
    writeString + readString:              7.5x

    writeMessageBegin + readMessageBegin: 11.6x
    complex struct/field write+read:       6.2x
    writeMapBegin + readMapBegin:         18.7x
    writeListBegin + readListBegin:       14.1x
    writeSetBegin + readSetBegin:         13.3x
    writeBool + readBool:                 13.2x
    writeByte + readByte:                 13.9x
    writeI16 + readI16:                    9.0x
    writeI32 + readI32:                    7.5x
    writeI64 + readI64:                   10.0x
    writeDouble + readDouble:             13.5x
    writeString + readString:              7.4x
@fmgoncalves fmgoncalves was assigned

Accepted and commited


@fmgoncalves fmgoncalves closed this
@jcbf jcbf referenced this issue from a commit in jcbf/p5-cassandra-simple
@jcbf jcbf Support for add_pool_from_ring() #1 5a74163
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.