Skip to content

enhance client, go lang server using writev #1

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

Closed
wants to merge 1 commit into from

Conversation

wheelcomplex
Copy link

go lang server must compiled by my shadow edition go with writev supported(https://github.com/wheelcomplex/go/commit/c724ea00112063cb84f308bdf7a3bfa6a398cb5b)

and work in linux x86_64 only.

@wheelcomplex
Copy link
Author

in my ubuntu 15.04 x64, I7 4700HQ (1 cpus for all server)
with writev:
go lang server: Elasped time is 44.00 seconds, bandwidth 6238.00 MB/s
cpp server: Elasped time is 221.00 seconds, bandwidth 6956.71 MB/s

without writev+group write:
go lang server: Elasped time is 45.00 seconds, bandwidth 2823.80 MB/s
cpp server: Elasped time is 55.00 seconds, bandwidth 5467.31 MB/s

@winlinvip
Copy link
Owner

Seems the writev is:

  1. When use write(p0, p1, ..., pN), the writev can avoid lots of syscall.
  2. When use bigbuffer(p0, p1, ..., pN), writev(bigbuffer) can avoid memory copy.

I have profile it at golang/go#13451 (comment)
The private implementation of writev is https://github.com/winlinvip/go/pull/1/files

@wheelcomplex
Copy link
Author

Thanks for your discovery, I have gave up this pull requests.

@winlinvip
Copy link
Owner

@wheelcomplex Will golang accept the proposal to support writev? Seems it's useful for server. 😺

@wheelcomplex
Copy link
Author

@winlinvip I do not know, I will keep it in my shadow edition for my selft :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants