[ 
https://issues.apache.org/jira/browse/THRIFT-2567?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14026332#comment-14026332
 ] 

Martin Vogt commented on THRIFT-2567:
-------------------------------------


Hello Jens,

>Jens Geyer added a comment - Yesterday 12:24
>really appreciate your work on this. Could you format the changes as a >patch 
>file, alternatively a GitHub pull request when you think it's ready to be 
>>reviewed?

There isn't an issue with with thrift. It was some performance
analysis. Luckily thrift in c# makes it easy to overwrite the
generated processor implementation, so that some tweaking
is possible.
Additionally I found the attached ArrayAsBytes.cs helpful, which
allows to cast a float[] array to a byte[] binary stream array. So there is
no need to call Buffer.BlockCopy from the thrift "byte layer" to
a float[] / vertex layer.
Overall, it looks, that mono on linux seems to be twice as fast as windows
(for the localhost communication)

regards,

Martin


> Csharp slow ?
> -------------
>
>                 Key: THRIFT-2567
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2567
>             Project: Thrift
>          Issue Type: Question
>          Components: C# - Library
>    Affects Versions: 1.0
>            Reporter: Martin Vogt
>            Assignee: Jens Geyer
>            Priority: Minor
>         Attachments: ArrayAsByte.cs, Client.cs, Server.cs
>
>
> Hello,
> I have a simple csharp server/client for performance tests,
> something like this
> {quote}
> service {
>  binary getData();
> }
> {quote}
> 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):
> {quote}
> http://www.java2s.com/Code/CSharp/Network/SimpleTcpClient.htm
> http://www.java2s.com/Code/CSharp/Network/SimpleTcpServer.htm
> {quote}
> 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:
> {quote}
> // pseudocode
>  byte[] getData() {
>   len=iprot.readi32()
>   byte[] x=new byte[len]
>   iprot.readAll(x,len);
>  return x;
> }
> {quote}
>  
> 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.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to