-
Notifications
You must be signed in to change notification settings - Fork 18k
net: tiny i/o is slower than in C #5643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
The files got from tcpdump and strace are too large to upload because of the maximum size of attachment. So I upload the revised files with NoDelay being false. I believe this issue is quite easy to reproduce. There is one thing I have not mentioned is that I just ran these programs on localhost(127.0.0.1), and I'm not sure whether it matters. Attachments:
|
Here is strace.txt.tar.gz. The file created by tcpdump is too big to attach. Attachments:
|
I can't reproduce on darwin/amd64. dtraces: https://gist.github.com/kylelemons/5719397 The only thing that happens is that as you disable nodelay and switch to C, a higher proportion of the server's writes are fast enough to be read by the same read syscall. It doesn't take much in such a tight loop to balloon the run time, so the difference between the C and Go version (+17%) and between the nagle and nodelay version (+25%) doesn't seem extraordinary, especially since in any real program the delay between writes will be dominated by other processing time (and writes won't be two-bytes each...). |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by steve.wangbin:
Attachments:
The text was updated successfully, but these errors were encountered: