Rich <ri...@example.invalid> wrote:
> Andreas Leitgeb <
a...@logic.at> wrote:
>> [long, detailed, explanation clipped, see original posting for the
>> details]
>> The delay occurs after each *first* "write this line", ...
>> Does such a socket-related delay ring any bells?
>
> The only bell it rings for me is the Nagle algorithm interaction with
> TCP delayed ACK's:
>
>
https://en.wikipedia.org/wiki/Nagle's_algorithm
>
> Scroll down to the paragraph starting: "This algorithm interacts badly
> with TCP delayed acknowledgments".
>
Yes, that seems to hit the nail on its head!
Thanks a lot! I wasn't aware of it.
In the meantime, based on experimental results, I changed the
protocol to always send a reply.
If I need better performance, I will remove the dummy replies
and set TCP_NODELAY on the Java side. I'm lucky, that that's the
side I'd need it for, because if it were the Tcl side, then it
seems like I'd have to wait for TIP 344, which is pending since
end of 2008.