thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Duru Can Celasun (Jira)" <j...@apache.org>
Subject [jira] [Commented] (THRIFT-5069) Go: TDserializer is not resource pool friendly
Date Sat, 18 Jan 2020 07:25:00 GMT

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

Duru Can Celasun commented on THRIFT-5069:
------------------------------------------

OK, sounds good. Let's include that in this PR.

> Go: TDserializer is not resource pool friendly
> ----------------------------------------------
>
>                 Key: THRIFT-5069
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5069
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Go - Library
>            Reporter: Yuxuan Wang
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently TSerializer is resource pool friendly (see [here|https://github.com/reddit/baseplate.go/blob/7b73f185eacd319a018df85d683fb2c29b50e2a9/events/events.go#L105-L111]
for an example), but TDeserializer is not. When putting a TDeserializer back into resource
pool, some extra works need to be done:
> {code:go}
> defer func() {
> 	deserializer.Transport.(*thrift.TMemoryBuffer).Reset()
> 	deserializerPool.Put(deserializer)
> }()
> {code}
> If we change the type of TDeserializer.Transport to *TMemoryBuffer, and also call Transport.Reset()
at the beginning of Read and ReadString (we already do both in TSerializer), it will make
it more resource pool friendly.
> This will be a breaking change, though.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message