• Brad Fitzpatrick's avatar
    net/textproto: reduce allocations in ReadMIMEHeader · 16c3f82e
    Brad Fitzpatrick authored
    ReadMIMEHeader is used by net/http, net/mail, and
    mime/multipart.
    
    Don't do so many small allocations. Calculate up front
    how much we'll probably need.
    
    benchmark                  old ns/op    new ns/op    delta
    BenchmarkReadMIMEHeader         8433         7467  -11.45%
    
    benchmark                 old allocs   new allocs    delta
    BenchmarkReadMIMEHeader           23           14  -39.13%
    
    benchmark                  old bytes    new bytes    delta
    BenchmarkReadMIMEHeader         1705         1343  -21.23%
    
    R=golang-dev, r, iant, adg
    CC=golang-dev
    https://golang.org/cl/8179043
    16c3f82e
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...