Skip to content
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

proposal: net: add tcp WriteTo func to enable splice socket data to file #48530

Open
jim3ma opened this issue Sep 22, 2021 · 2 comments
Open

proposal: net: add tcp WriteTo func to enable splice socket data to file #48530

jim3ma opened this issue Sep 22, 2021 · 2 comments
Labels
Projects
Milestone

Comments

@jim3ma
Copy link

@jim3ma jim3ma commented Sep 22, 2021

When transfer data from tcp socket to file directly, splice will help us with low time cost in linux. Currently, os.File just uses write to transfer data from tcp socket.

To do this in linux, there are some changes:

  1. add LimitWriter to detect writing limit in internal package, discussed in this issues.
  2. add spliceW function to splice data from tcp socket to file.
  3. add WriteTo function for net.TCPConn.

We get 10% at least cpu time reduce, zero memory copy from kernel to user space.

image

Implement PR: #46149, go review

@gopherbot gopherbot added this to the Proposal milestone Sep 22, 2021
@ianlancetaylor ianlancetaylor added this to Incoming in Proposals Sep 22, 2021
@rsc
Copy link
Contributor

@rsc rsc commented Oct 6, 2021

What are the specific API changes you are proposing?

@rsc
Copy link
Contributor

@rsc rsc commented Oct 6, 2021

This proposal has been added to the active column of the proposals project
and will now be reviewed at the weekly proposal review meetings.
— rsc for the proposal review group

@rsc rsc moved this from Incoming to Active in Proposals Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants