Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Currently TSerializer is resource pool friendly (see here for an example), but TDeserializer is not. When putting a TDeserializer back into resource pool, some extra works need to be done:
defer func() { deserializer.Transport.(*thrift.TMemoryBuffer).Reset() deserializerPool.Put(deserializer) }()
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.
Attachments
Issue Links
- links to