Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

wish: Consider use thrift-xs #1

Closed
jcbf opened this Issue · 1 comment

2 participants

@jcbf

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 http://search.cpan.org/~agrundma/Thrift-XS-1.04/ or https://github.com/andygrundman/thrift-xs
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

XS::BinaryProtocol
    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

XS::CompactProtocol
    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
@fmgoncalves
Owner

Accepted and commited

de6f1bf

@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.