thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James E. King III (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (THRIFT-4714) Java TFramedTransport calls write twice for each flush
Date Fri, 04 Jan 2019 03:07:00 GMT

     [ https://issues.apache.org/jira/browse/THRIFT-4714?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

James E. King III updated THRIFT-4714:
--------------------------------------
    Affects Version/s:     (was: 0.7)
                       0.6

> Java TFramedTransport calls write twice for each flush
> ------------------------------------------------------
>
>                 Key: THRIFT-4714
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4714
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Java - Library
>    Affects Versions: 0.6
>            Reporter: James E. King III
>            Assignee: James E. King III
>            Priority: Major
>             Fix For: 1.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Code calls two writes to the underlying transport per flush: one for the frame size and
one for the payload.  The result is that folks use TBufferedTransport on top of TFramedTransport
to avoid getting two ethernet frames for small packets.  This means everything is double-buffered!
> Based on THRIFT-1121 and THRIFT-959 this may have been an issue for a long time - the
fix was easy however.  We make room for the frame size before writing to the buffer, then
we only have to pull out the buffer, drop the frame size into the 4 bytes that we pre-allocated,
and then write to the underlying transport once.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message