You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Bryan Duxbury (JIRA)" <ji...@apache.org> on 2010/07/27 20:53:15 UTC

[jira] Created: (THRIFT-831) FramedTransport implementation that reuses its buffers

FramedTransport implementation that reuses its buffers
------------------------------------------------------

                 Key: THRIFT-831
                 URL: https://issues.apache.org/jira/browse/THRIFT-831
             Project: Thrift
          Issue Type: New Feature
          Components: Library (Java)
            Reporter: Bryan Duxbury
            Assignee: Bryan Duxbury
             Fix For: 0.4


The current version of TFramedTransport allocates new read and write buffers every time a frame is read or written. This is wasteful, leading to expensive byte[] allocations, soaking up cpu and GC time unnecessarily. 

It would be handy to have an implementation that automatically reuses existing buffers if they're big enough, and grows them as appropriate. My testing shows this to be as much as a 60% reduction in CPU cost in dealing with the transport.

I think it's important for us to keep separate implementations available, since different applications might prefer to spend the CPU time to avoid having a big chunk of memory permanently allocated.

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


[jira] Commented: (THRIFT-831) FramedTransport implementation that reuses its buffers

Posted by "Jeremy Hanna (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12894183#action_12894183 ] 

Jeremy Hanna commented on THRIFT-831:
-------------------------------------

I compiled trunk + this patch and changed the CassandraDaemon to use TFramedTransportWithReusableBuffer instead of TFramedTransport.  When running the unit tests, a couple of tests timed out where it was using the thrift client.  Also, the set of system/integration tests that do stuff with the python client all appear to be timing out.

> FramedTransport implementation that reuses its buffers
> ------------------------------------------------------
>
>                 Key: THRIFT-831
>                 URL: https://issues.apache.org/jira/browse/THRIFT-831
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>             Fix For: 0.4
>
>         Attachments: thrift-831.patch
>
>
> The current version of TFramedTransport allocates new read and write buffers every time a frame is read or written. This is wasteful, leading to expensive byte[] allocations, soaking up cpu and GC time unnecessarily. 
> It would be handy to have an implementation that automatically reuses existing buffers if they're big enough, and grows them as appropriate. My testing shows this to be as much as a 60% reduction in CPU cost in dealing with the transport.
> I think it's important for us to keep separate implementations available, since different applications might prefer to spend the CPU time to avoid having a big chunk of memory permanently allocated.

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


[jira] Updated: (THRIFT-831) FramedTransport implementation that reuses its buffers

Posted by "T Jake Luciani (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-831?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

T Jake Luciani updated THRIFT-831:
----------------------------------

    Comment: was deleted

(was: Why would someone use the old TFramedTransport over this one? Seems like we should just replace it?)

> FramedTransport implementation that reuses its buffers
> ------------------------------------------------------
>
>                 Key: THRIFT-831
>                 URL: https://issues.apache.org/jira/browse/THRIFT-831
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>             Fix For: 0.4
>
>         Attachments: thrift-831.patch
>
>
> The current version of TFramedTransport allocates new read and write buffers every time a frame is read or written. This is wasteful, leading to expensive byte[] allocations, soaking up cpu and GC time unnecessarily. 
> It would be handy to have an implementation that automatically reuses existing buffers if they're big enough, and grows them as appropriate. My testing shows this to be as much as a 60% reduction in CPU cost in dealing with the transport.
> I think it's important for us to keep separate implementations available, since different applications might prefer to spend the CPU time to avoid having a big chunk of memory permanently allocated.

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


[jira] Commented: (THRIFT-831) FramedTransport implementation that reuses its buffers

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12892940#action_12892940 ] 

Jonathan Ellis commented on THRIFT-831:
---------------------------------------

TRetainedFramedTransport ?

> FramedTransport implementation that reuses its buffers
> ------------------------------------------------------
>
>                 Key: THRIFT-831
>                 URL: https://issues.apache.org/jira/browse/THRIFT-831
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>             Fix For: 0.4
>
>         Attachments: thrift-831.patch
>
>
> The current version of TFramedTransport allocates new read and write buffers every time a frame is read or written. This is wasteful, leading to expensive byte[] allocations, soaking up cpu and GC time unnecessarily. 
> It would be handy to have an implementation that automatically reuses existing buffers if they're big enough, and grows them as appropriate. My testing shows this to be as much as a 60% reduction in CPU cost in dealing with the transport.
> I think it's important for us to keep separate implementations available, since different applications might prefer to spend the CPU time to avoid having a big chunk of memory permanently allocated.

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


[jira] Commented: (THRIFT-831) FramedTransport implementation that reuses its buffers

Posted by "Jeremy Hanna (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12895798#action_12895798 ] 

Jeremy Hanna commented on THRIFT-831:
-------------------------------------

Bryan, Jonathan said it for me - you should be able to replicate it easily with those two types of tests.  If you would like more specifics or cannot replicate it with unit or system tests, please let us know.

> FramedTransport implementation that reuses its buffers
> ------------------------------------------------------
>
>                 Key: THRIFT-831
>                 URL: https://issues.apache.org/jira/browse/THRIFT-831
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>            Priority: Blocker
>             Fix For: 0.4
>
>         Attachments: thrift-831.patch
>
>
> The current version of TFramedTransport allocates new read and write buffers every time a frame is read or written. This is wasteful, leading to expensive byte[] allocations, soaking up cpu and GC time unnecessarily. 
> It would be handy to have an implementation that automatically reuses existing buffers if they're big enough, and grows them as appropriate. My testing shows this to be as much as a 60% reduction in CPU cost in dealing with the transport.
> I think it's important for us to keep separate implementations available, since different applications might prefer to spend the CPU time to avoid having a big chunk of memory permanently allocated.

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


[jira] Closed: (THRIFT-831) FramedTransport implementation that reuses its buffers

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-831?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury closed THRIFT-831.
--------------------------------

    Resolution: Fixed

I just committed this.

> FramedTransport implementation that reuses its buffers
> ------------------------------------------------------
>
>                 Key: THRIFT-831
>                 URL: https://issues.apache.org/jira/browse/THRIFT-831
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>            Priority: Blocker
>             Fix For: 0.4
>
>         Attachments: thrift-831-v2.patch, thrift-831.patch
>
>
> The current version of TFramedTransport allocates new read and write buffers every time a frame is read or written. This is wasteful, leading to expensive byte[] allocations, soaking up cpu and GC time unnecessarily. 
> It would be handy to have an implementation that automatically reuses existing buffers if they're big enough, and grows them as appropriate. My testing shows this to be as much as a 60% reduction in CPU cost in dealing with the transport.
> I think it's important for us to keep separate implementations available, since different applications might prefer to spend the CPU time to avoid having a big chunk of memory permanently allocated.

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


[jira] Commented: (THRIFT-831) FramedTransport implementation that reuses its buffers

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12892895#action_12892895 ] 

Jonathan Ellis commented on THRIFT-831:
---------------------------------------

TFramedTransportWithReusableBuffer sure is a mouthful :)

> FramedTransport implementation that reuses its buffers
> ------------------------------------------------------
>
>                 Key: THRIFT-831
>                 URL: https://issues.apache.org/jira/browse/THRIFT-831
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>             Fix For: 0.4
>
>         Attachments: thrift-831.patch
>
>
> The current version of TFramedTransport allocates new read and write buffers every time a frame is read or written. This is wasteful, leading to expensive byte[] allocations, soaking up cpu and GC time unnecessarily. 
> It would be handy to have an implementation that automatically reuses existing buffers if they're big enough, and grows them as appropriate. My testing shows this to be as much as a 60% reduction in CPU cost in dealing with the transport.
> I think it's important for us to keep separate implementations available, since different applications might prefer to spend the CPU time to avoid having a big chunk of memory permanently allocated.

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


[jira] Commented: (THRIFT-831) FramedTransport implementation that reuses its buffers

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12894606#action_12894606 ] 

Bryan Duxbury commented on THRIFT-831:
--------------------------------------

Jeremy - could you possibly describe the nature of the tests that are failing in more detail so that I can try to reproduce the problem? The tests I have now seem to work, but that probably just means they're incomplete.

> FramedTransport implementation that reuses its buffers
> ------------------------------------------------------
>
>                 Key: THRIFT-831
>                 URL: https://issues.apache.org/jira/browse/THRIFT-831
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>             Fix For: 0.4
>
>         Attachments: thrift-831.patch
>
>
> The current version of TFramedTransport allocates new read and write buffers every time a frame is read or written. This is wasteful, leading to expensive byte[] allocations, soaking up cpu and GC time unnecessarily. 
> It would be handy to have an implementation that automatically reuses existing buffers if they're big enough, and grows them as appropriate. My testing shows this to be as much as a 60% reduction in CPU cost in dealing with the transport.
> I think it's important for us to keep separate implementations available, since different applications might prefer to spend the CPU time to avoid having a big chunk of memory permanently allocated.

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


[jira] Commented: (THRIFT-831) FramedTransport implementation that reuses its buffers

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12892915#action_12892915 ] 

Bryan Duxbury commented on THRIFT-831:
--------------------------------------

Definitely open to alternatives if you'd like to suggest some.

> FramedTransport implementation that reuses its buffers
> ------------------------------------------------------
>
>                 Key: THRIFT-831
>                 URL: https://issues.apache.org/jira/browse/THRIFT-831
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>             Fix For: 0.4
>
>         Attachments: thrift-831.patch
>
>
> The current version of TFramedTransport allocates new read and write buffers every time a frame is read or written. This is wasteful, leading to expensive byte[] allocations, soaking up cpu and GC time unnecessarily. 
> It would be handy to have an implementation that automatically reuses existing buffers if they're big enough, and grows them as appropriate. My testing shows this to be as much as a 60% reduction in CPU cost in dealing with the transport.
> I think it's important for us to keep separate implementations available, since different applications might prefer to spend the CPU time to avoid having a big chunk of memory permanently allocated.

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


[jira] Commented: (THRIFT-831) FramedTransport implementation that reuses its buffers

Posted by "T Jake Luciani (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12894195#action_12894195 ] 

T Jake Luciani commented on THRIFT-831:
---------------------------------------

Why would someone use the old TFramedTransport over this one? Seems like we should just replace it?

> FramedTransport implementation that reuses its buffers
> ------------------------------------------------------
>
>                 Key: THRIFT-831
>                 URL: https://issues.apache.org/jira/browse/THRIFT-831
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>             Fix For: 0.4
>
>         Attachments: thrift-831.patch
>
>
> The current version of TFramedTransport allocates new read and write buffers every time a frame is read or written. This is wasteful, leading to expensive byte[] allocations, soaking up cpu and GC time unnecessarily. 
> It would be handy to have an implementation that automatically reuses existing buffers if they're big enough, and grows them as appropriate. My testing shows this to be as much as a 60% reduction in CPU cost in dealing with the transport.
> I think it's important for us to keep separate implementations available, since different applications might prefer to spend the CPU time to avoid having a big chunk of memory permanently allocated.

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


[jira] Updated: (THRIFT-831) FramedTransport implementation that reuses its buffers

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-831?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury updated THRIFT-831:
---------------------------------

    Priority: Blocker  (was: Major)

> FramedTransport implementation that reuses its buffers
> ------------------------------------------------------
>
>                 Key: THRIFT-831
>                 URL: https://issues.apache.org/jira/browse/THRIFT-831
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>            Priority: Blocker
>             Fix For: 0.4
>
>         Attachments: thrift-831.patch
>
>
> The current version of TFramedTransport allocates new read and write buffers every time a frame is read or written. This is wasteful, leading to expensive byte[] allocations, soaking up cpu and GC time unnecessarily. 
> It would be handy to have an implementation that automatically reuses existing buffers if they're big enough, and grows them as appropriate. My testing shows this to be as much as a 60% reduction in CPU cost in dealing with the transport.
> I think it's important for us to keep separate implementations available, since different applications might prefer to spend the CPU time to avoid having a big chunk of memory permanently allocated.

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


[jira] Commented: (THRIFT-831) FramedTransport implementation that reuses its buffers

Posted by "Jeremy Hanna (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12896096#action_12896096 ] 

Jeremy Hanna commented on THRIFT-831:
-------------------------------------

I can go ahead and test it out.

> FramedTransport implementation that reuses its buffers
> ------------------------------------------------------
>
>                 Key: THRIFT-831
>                 URL: https://issues.apache.org/jira/browse/THRIFT-831
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>            Priority: Blocker
>             Fix For: 0.4
>
>         Attachments: thrift-831-v2.patch, thrift-831.patch
>
>
> The current version of TFramedTransport allocates new read and write buffers every time a frame is read or written. This is wasteful, leading to expensive byte[] allocations, soaking up cpu and GC time unnecessarily. 
> It would be handy to have an implementation that automatically reuses existing buffers if they're big enough, and grows them as appropriate. My testing shows this to be as much as a 60% reduction in CPU cost in dealing with the transport.
> I think it's important for us to keep separate implementations available, since different applications might prefer to spend the CPU time to avoid having a big chunk of memory permanently allocated.

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


[jira] Updated: (THRIFT-831) FramedTransport implementation that reuses its buffers

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-831?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury updated THRIFT-831:
---------------------------------

    Attachment: thrift-831-v2.patch

I think this fixes the problem. I was missing a flush() call on the underlying transport. 

I was unable to test the change in Cassandra itself because after committing THRIFT-830, Cassandra TRUNK no longer compiles. (I assume we need patches from Nate on that front.)

> FramedTransport implementation that reuses its buffers
> ------------------------------------------------------
>
>                 Key: THRIFT-831
>                 URL: https://issues.apache.org/jira/browse/THRIFT-831
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>            Priority: Blocker
>             Fix For: 0.4
>
>         Attachments: thrift-831-v2.patch, thrift-831.patch
>
>
> The current version of TFramedTransport allocates new read and write buffers every time a frame is read or written. This is wasteful, leading to expensive byte[] allocations, soaking up cpu and GC time unnecessarily. 
> It would be handy to have an implementation that automatically reuses existing buffers if they're big enough, and grows them as appropriate. My testing shows this to be as much as a 60% reduction in CPU cost in dealing with the transport.
> I think it's important for us to keep separate implementations available, since different applications might prefer to spend the CPU time to avoid having a big chunk of memory permanently allocated.

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


[jira] Commented: (THRIFT-831) FramedTransport implementation that reuses its buffers

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12893350#action_12893350 ] 

Bryan Duxbury commented on THRIFT-831:
--------------------------------------

TFastFramedTransport?

> FramedTransport implementation that reuses its buffers
> ------------------------------------------------------
>
>                 Key: THRIFT-831
>                 URL: https://issues.apache.org/jira/browse/THRIFT-831
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>             Fix For: 0.4
>
>         Attachments: thrift-831.patch
>
>
> The current version of TFramedTransport allocates new read and write buffers every time a frame is read or written. This is wasteful, leading to expensive byte[] allocations, soaking up cpu and GC time unnecessarily. 
> It would be handy to have an implementation that automatically reuses existing buffers if they're big enough, and grows them as appropriate. My testing shows this to be as much as a 60% reduction in CPU cost in dealing with the transport.
> I think it's important for us to keep separate implementations available, since different applications might prefer to spend the CPU time to avoid having a big chunk of memory permanently allocated.

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


[jira] Updated: (THRIFT-831) FramedTransport implementation that reuses its buffers

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-831?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury updated THRIFT-831:
---------------------------------

    Attachment: thrift-831.patch

Here's my first draft. All the tests pass, and it's a lot faster. 

> FramedTransport implementation that reuses its buffers
> ------------------------------------------------------
>
>                 Key: THRIFT-831
>                 URL: https://issues.apache.org/jira/browse/THRIFT-831
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>             Fix For: 0.4
>
>         Attachments: thrift-831.patch
>
>
> The current version of TFramedTransport allocates new read and write buffers every time a frame is read or written. This is wasteful, leading to expensive byte[] allocations, soaking up cpu and GC time unnecessarily. 
> It would be handy to have an implementation that automatically reuses existing buffers if they're big enough, and grows them as appropriate. My testing shows this to be as much as a 60% reduction in CPU cost in dealing with the transport.
> I think it's important for us to keep separate implementations available, since different applications might prefer to spend the CPU time to avoid having a big chunk of memory permanently allocated.

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


[jira] Commented: (THRIFT-831) FramedTransport implementation that reuses its buffers

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12894615#action_12894615 ] 

Jonathan Ellis commented on THRIFT-831:
---------------------------------------

The Cassandra unit tests run with "ant test," the system tests with "nosetests".  (details on installing nose etc. at http://wiki.apache.org/cassandra/HowToContribute)

> FramedTransport implementation that reuses its buffers
> ------------------------------------------------------
>
>                 Key: THRIFT-831
>                 URL: https://issues.apache.org/jira/browse/THRIFT-831
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>             Fix For: 0.4
>
>         Attachments: thrift-831.patch
>
>
> The current version of TFramedTransport allocates new read and write buffers every time a frame is read or written. This is wasteful, leading to expensive byte[] allocations, soaking up cpu and GC time unnecessarily. 
> It would be handy to have an implementation that automatically reuses existing buffers if they're big enough, and grows them as appropriate. My testing shows this to be as much as a 60% reduction in CPU cost in dealing with the transport.
> I think it's important for us to keep separate implementations available, since different applications might prefer to spend the CPU time to avoid having a big chunk of memory permanently allocated.

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


[jira] Commented: (THRIFT-831) FramedTransport implementation that reuses its buffers

Posted by "Jeremy Hanna (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12896157#action_12896157 ] 

Jeremy Hanna commented on THRIFT-831:
-------------------------------------

you're right - I had misunderstood - cassandra trunk doesn't currently compile with the changes.

> FramedTransport implementation that reuses its buffers
> ------------------------------------------------------
>
>                 Key: THRIFT-831
>                 URL: https://issues.apache.org/jira/browse/THRIFT-831
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Library (Java)
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>            Priority: Blocker
>             Fix For: 0.4
>
>         Attachments: thrift-831-v2.patch, thrift-831.patch
>
>
> The current version of TFramedTransport allocates new read and write buffers every time a frame is read or written. This is wasteful, leading to expensive byte[] allocations, soaking up cpu and GC time unnecessarily. 
> It would be handy to have an implementation that automatically reuses existing buffers if they're big enough, and grows them as appropriate. My testing shows this to be as much as a 60% reduction in CPU cost in dealing with the transport.
> I think it's important for us to keep separate implementations available, since different applications might prefer to spend the CPU time to avoid having a big chunk of memory permanently allocated.

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