Details
-
Question
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
Hello,
I have a simple csharp server/client for performance tests,
something like this
service {
binary getData();
}
which returns a 1MB buffer.(git snapshot from a few days ago).
A thrift call client->server takes 8ms
according to stopWatch.Elapsed. The same client->server
implemented from here(modified of course):
http://www.java2s.com/Code/CSharp/Network/SimpleTcpClient.htm
http://www.java2s.com/Code/CSharp/Network/SimpleTcpServer.htm
takes ~1ms. (Factor 8 faster, than the thrift client/server, all localhost
connections on windows)
I tried to narrow it down where the actual problem is, but without
luck so far.
- Its not the binary stream creation during unmarshall:
// pseudocode
byte[] getData() {
len=iprot.readi32()
byte[] x=new byte[len]
iprot.readAll(x,len);
return x;
}
It looks that its in the thrift c# library classes (TSocket,etc..),
but up to now I haven't found an explanation for the
differences.