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

net/http: speed up BenchmarkHeaderWriteSubset #3761

Closed
bradfitz opened this issue Jun 19, 2012 · 4 comments
Closed

net/http: speed up BenchmarkHeaderWriteSubset #3761

bradfitz opened this issue Jun 19, 2012 · 4 comments
Milestone

Comments

@bradfitz
Copy link
Contributor

Tracking bug.

It'd be nice if sort could work on stack values.

The CL experimented with forking part of the sort package so escape analysis permitted
sorting an array on the stack:

http://golang.org/cl/6265047/diff/3/src/pkg/net/http/header.go

For reference, at 5b56c2c0597f on gopher.mtv with no modifications:

$ go test -v -run=^$ -bench=Subset
PASS
BenchmarkHeaderWriteSubset    500000          3050 ns/op
ok      net/http    1.569s

With the version of CL linked above (Patch Set 4, despite URL saying /3/)

BenchmarkHeaderWriteSubset   1000000          1983 ns/op


That's not all from sort, but IIRC a lot was.

Related: net/url.Values.Encode could also benefit from a sorting stack values.
@rsc
Copy link
Contributor

rsc commented Sep 12, 2012

Comment 1:

Labels changed: added go1.1.

@rsc
Copy link
Contributor

rsc commented Dec 10, 2012

Comment 2:

Labels changed: added size-l.

@bradfitz
Copy link
Contributor Author

bradfitz commented Mar 6, 2013

Comment 3:

As of today, on the same machine as the original report:
bradfitz@gopher:~/go/src$ hg id
91db139d15e5+ tip
$ go test -run=XXX -bench=Subset net/http
PASS
BenchmarkHeaderWriteSubset  500000   2354 ns/op   197 B/op   2 allocs/op

@bradfitz
Copy link
Contributor Author

bradfitz commented Mar 6, 2013

Comment 4:

This issue was closed by revision a30bede.

Status changed to Fixed.

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
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