0

I see a non-blocking Thrift transport implementation for socket-based IO, but nothing obvious for file IO.

I'm fairly new to NIO and would like to improve the performance of my file stream-based Thrift (de)serialiser by switching to NIO (buffers/channels etc).

Any suggestions appreciated.

Chris Beach
  • 4,302
  • 2
  • 31
  • 50

1 Answers1

2

Of the concrete transports only the server and client nonblocking sockets use NIO. I think you could use TSimpleFileTransport as a model and build an NIO version pretty easily. Not sure if that would make a noticeable difference in the [de]serialization performance however. Would be interesting to hear what you find if you do any experiments.

TDeserializer will deserialize arbitrary byte arrays and strings, which might be useful if you have a fast nonthrift way to get the data into memory.

codeSF
  • 1,162
  • 9
  • 16
  • I did try extending the Thrift transport implementation to use NIO. It actually slowed things down - although I'm not convinced I've managed to get the best out of it. – Chris Beach Jan 28 '14 at 22:22
  • Don't expect nio to increase speed. In most cases, nio makes responsiveness a bit slower than bio(blocking IO). Nio is usually used to increase concurrency and scalability – ligerdave May 02 '14 at 08:42