Thank you very much. This solves my issue.
This is the correct cause. Reproducing your test gives 38-45ms in each of 10 runs. If you run a profiler against it, you can see that the time is entirely spent blocking on receive in TStreamTransport.Read.Your test can be modified with the following line:coreTransport.TcpClient.NoDelay = true;
After disabling Nagle's each test runs in < 1ms.MichaelOn Fri, Sep 17, 2010 at 9:57 AM, Peter Schuller <firstname.lastname@example.org> wrote:> The latency is about 200 ms on every request when I'm connected to anotherMy first thought here was that maybe you're seeing the effects of
nagle + delayed acks on the other side. On Unix, normally something
like a thrift client would set TCP_NODELAY on its socket to avoid the
problem. I'm not sure whether or not this is a reasonable hypothesis
with C# + Thrift on Windows. Sorry, I don't know what the easy fix is
either but perhaps it might help dig further.
/ Peter Schuller