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

bytes: io.Reader made by bytes.NewBuffer() is inefficiency in io.Copy() #10009

Closed
heidawei opened this issue Feb 26, 2015 · 1 comment
Closed

Comments

@heidawei
Copy link

io.Reader make by bytes.NewBuffer() is inefficiency in io.Copy() (in my test the server's QPS is 3000), but io.Reader come from http req.body(it is a io.Reader object) is efficient in io.Copy() (the server's QPS is 8000). in my test the []byte convert to io.Reader object, then copy to a io.Writer object.when i test this io.Writer like this:
w.Write(payload[:])
the w is a io.Writer object, the efficiency is same with the io.Reader make by bytes.NewBuffer().
who can tell me how to deal this?

@bradfitz
Copy link
Contributor

Let's bring this to the golang-nuts@ mailing list and consider reopening here when there's something more concrete to go on.

@mikioh mikioh changed the title io.Reader make by bytes.NewBuffer() is inefficiency in io.Copy() bytes: io.Reader made by bytes.NewBuffer() is inefficiency in io.Copy() Feb 27, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants