[ 
https://issues.apache.org/jira/browse/THRIFT-248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662470#action_12662470
 ] 

Bryan Duxbury commented on THRIFT-248:
--------------------------------------

So, here are the updated numbers:

trunk, raw binary protocol
5.17004799842834
3.92461395263672

trunk bpa
0.588052034378052
0.478676795959473

thrift_native w/rb binary protocol
1.880854845047
2.82080793380737

thrift_native w/c binary protocol
1.13735699653625
1.25881004333496

So, the latest update has made writing about 30% faster and reading about 100% 
faster. It's still about 2x and 3x as slow for reading and writing, 
respectively, as using the trunk BinaryProtocolAccelerated. I profiled, and it 
looks like a pretty substantial portion of the time is being spent in 
Thrift::MemoryBuffer, which is all ruby, and which the BPA implementation 
doesn't really touch. I'll take a look at that next.

> Factor BinaryProtocolAccelerated into separate protocol and struct components
> -----------------------------------------------------------------------------
>
>                 Key: THRIFT-248
>                 URL: https://issues.apache.org/jira/browse/THRIFT-248
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Library (Ruby)
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>            Priority: Minor
>         Attachments: thrift-248-v2.patch, thrift-248-v3.patch, 
> thrift-248-v4.patch, thrift-248.patch
>
>
> Kevin Clark's excelled BinaryProtocolAccelerated implementation in the Ruby 
> library is very fast, in large part due to the fact that it implements not 
> just the protocol but also the struct components of serialization directly as 
> a C extension. The problem with this arrangement is that other protocols that 
> would benefit from accelerated struct code don't get the benefit. In 
> particular, I'd like to make my implementation of the Compact Protocol fast 
> in Ruby, and the key appears to be the struct serialization code. 
> I think that we should make an effort to divorce the struct stuff from the 
> protocol stuff in BinaryProtocolAccelerated, so that all protocols can 
> benefit. Some quick benchmarking seems to indicate that there is going to be 
> some additional method call overhead in this situation, but it's not really 
> that substantial. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to