]> Cypherpunks repositories - gostls13.git/commit
net/http/httputil: eliminate duplicate alloc/copy in ReverseProxy
authorBlake Mizerany <blake.mizerany@gmail.com>
Mon, 23 Jan 2017 19:03:03 +0000 (11:03 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 1 Feb 2017 21:43:05 +0000 (21:43 +0000)
commitb48c419c4109a1c0e1e7a60a7a28659f6a92e827
tree89952b6b949bc22b49d355c7323ec025102fab9e
parent435450bf3c6efcc65111e96a42fc1c8acd3081e3
net/http/httputil: eliminate duplicate alloc/copy in ReverseProxy

This commit elimates the request allocation and shallow copy duplication
already done by req.WithContext.

name         old time/op    new time/op    delta
ServeHTTP-4     216µs ±36%     212µs ±15%     ~     (p=0.853 n=10+10)

name         old alloc/op   new alloc/op   delta
ServeHTTP-4     917kB ±36%    1137kB ± 0%     ~     (p=0.352 n=10+10)

name         old allocs/op  new allocs/op  delta
ServeHTTP-4      5.00 ± 0%      4.00 ± 0%  -20.00%  (p=0.000 n=10+10)

Change-Id: I514a59c30b037c7a65c355b06fd82c2d6ff17bb0
Reviewed-on: https://go-review.googlesource.com/35569
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/net/http/httputil/reverseproxy.go
src/net/http/httputil/reverseproxy_test.go