Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(473)

Unified Diff: src/pkg/net/http/request.go

Issue 6843056: code review 6843056: net/http, net/textproto: cache common header values (Closed)
Patch Set: diff -r 591fc8a0131a https://code.google.com/p/go Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/pkg/net/http/response.go » ('j') | src/pkg/net/http/response.go » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pkg/net/http/request.go
===================================================================
--- a/src/pkg/net/http/request.go
+++ b/src/pkg/net/http/request.go
@@ -17,7 +17,6 @@
"io/ioutil"
"mime"
"mime/multipart"
- "net/textproto"
"net/url"
"strconv"
"strings"
@@ -449,7 +448,10 @@
// ReadRequest reads and parses a request from b.
func ReadRequest(b *bufio.Reader) (req *Request, err error) {
- tp := textproto.NewReader(b)
+ tp := tpFree.get()
+ tp.R = b
+ defer tpFree.put(tp)
dfc 2012/11/20 09:18:35 The defer costs you an allocation so I don't think
+
req = new(Request)
// First line: GET /index.html HTTP/1.0
« no previous file with comments | « no previous file | src/pkg/net/http/response.go » ('j') | src/pkg/net/http/response.go » ('J')

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b