[
https://issues.apache.org/jira/browse/THRIFT-3612?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15142256#comment-15142256
]
ASF GitHub Bot commented on THRIFT-3612:
----------------------------------------
GitHub user nsuke opened a pull request:
https://github.com/apache/thrift/pull/844
THRIFT-3612 Add Python C extension for compact protocol
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/nsuke/thrift THRIFT-3612
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/thrift/pull/844.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #844
----
commit 80606c5a4ecc6288f9297dfe704c469188cb6586
Author: Nobuaki Sukegawa <[email protected]>
Date: 2016-02-11T04:58:39Z
THRIFT-3612 Add Python C extension for compact protocol
----
> Add Python C extension for compact protocol
> -------------------------------------------
>
> Key: THRIFT-3612
> URL: https://issues.apache.org/jira/browse/THRIFT-3612
> Project: Thrift
> Issue Type: Improvement
> Reporter: Aki Sukegawa
> Assignee: Aki Sukegawa
>
> I've extracted fastbinary.c TBinary implementation to a C++ class and added
> TCompact counter part.
> It can be used in the same way as TBinaryProtocolAccelerated.
> Note that it now requires C++ compiler but I don't think it affects anyone
> compiling Thrift Python module.
> Here's a quick benchmark:
> {code}
> $ PYTHONPATH=lib/py/build/lib.linux-x86_64-2.7:test/py/gen-py \
> test/py/FastbinaryTest.py
> Testing TBinaryAccelerated
> Starting Benchmarks
> HolyMoley Standard = 0.599830
> HolyMoley Acceler. = 0.028437
> FastStruct Standard = 0.151254
> FastStruct Acceler. = 0.010000
> Testing TCompactAccelerated
> Starting Benchmarks
> HolyMoley Standard = 1.200082
> HolyMoley Acceler. = 0.029162
> FastStruct Standard = 0.420377
> FastStruct Acceler. = 0.012183
> {code}
> It's ~40x faster than pure python implementation, partly because pure-python
> TCompact is much slower than TBinary for some reason.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)