Pregunta

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.

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top