You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
net/http: Optimize internal Cookie functions
- Pre-calculate *Cookie slice in read cookie functions
- readSetCookies: pre-allocs depending on the count of Set-Cookies, avoid
allocs when no Set-Cookie is present
- readCookies: calculate *Cookie slice length
- Rename success variable to ok; avoid else
- Refactor Cookie.String() to use less allocations
- Remove fmt package and replace with writes to a bytes.Buffer
- Add BenchmarkReadSetCookies() and BenchmarkReadCookies()
Add BenchmarkCookieString()
1000000 2153 ns/op 520 B/op 10 allocs/op <= Original Go 1.7
1000000 1221 ns/op 384 B/op 3 allocs/op <= Modified Go 1.7
That benchmark is from my MacBook Pro 2.4 GHz Intel Core i5 ;-)
If I need to change anything in the CL let me know or just merge (or not) and close this issue.
Thanks!
What version of Go are you using (go version)?
go version devel +79db162 Fri Sep 30 05:15:19 2016 +0000 darwin/amd64
The text was updated successfully, but these errors were encountered:
Sorry, but this doesn't seem important enough to spend time reviewing, at least for me. Is this actually a bottleneck for your application, or did you just want to optimize it for fun? If you have spare time, I have a list of bugs you might be interested in.
I've send a CL some time ago and wonders what else I need to do to get my first contribution to Go merged into master?
https://go-review.googlesource.com/#/c/27850/
That benchmark is from my MacBook Pro 2.4 GHz Intel Core i5 ;-)
If I need to change anything in the CL let me know or just merge (or not) and close this issue.
Thanks!
What version of Go are you using (
go version
)?go version devel +79db162 Fri Sep 30 05:15:19 2016 +0000 darwin/amd64
The text was updated successfully, but these errors were encountered: