]> Cypherpunks repositories - gostls13.git/commit
net/http: avoid a bunch of unnecessary CanonicalHeaderKey calls
authorBrad Fitzpatrick <bradfitz@golang.org>
Mon, 28 May 2012 18:07:24 +0000 (11:07 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 28 May 2012 18:07:24 +0000 (11:07 -0700)
commit1e814df79bdacc618dfe9768dfdece16c7b0a499
treead919c75cb3be40ca9db2c5fd36e790b1289e295
parentc238031b2de1a83e0441b4696dd7c2754e80688b
net/http: avoid a bunch of unnecessary CanonicalHeaderKey calls

CanonicalHeaderKey didn't allocate, but it did use unnecessary
CPU in the hot path, deciding it didn't need to allocate.

I considered using constants for all these common header keys
but I didn't think it would be prettier. "Content-Length" looks
better than contentLength or hdrContentLength, etc.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/6255053
src/pkg/net/http/header.go
src/pkg/net/http/request.go
src/pkg/net/http/server.go
src/pkg/net/http/transfer.go