我看到基于套接字的 IO 的非阻塞 Thrift 传输实现,但对于文件 IO 来说没有什么明显的。
我对 NIO 还很陌生,想通过切换到 NIO(缓冲区/通道等)来提高基于文件流的 Thrift(反)序列化器的性能。
任何建议表示赞赏。
我看到基于套接字的 IO 的非阻塞 Thrift 传输实现,但对于文件 IO 来说没有什么明显的。
我对 NIO 还很陌生,想通过切换到 NIO(缓冲区/通道等)来提高基于文件流的 Thrift(反)序列化器的性能。
任何建议表示赞赏。
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.