• Andrew Gerrand's avatar
    net/url: use bytes.Buffer in (*URL).String · da82dfac
    Andrew Gerrand authored
    BenchmarkString before:
    
            11990 ns/op            1621 B/op         73 allocs/op
    
    Using bytes.Buffer:
    
            8774 ns/op            1994 B/op         40 allocs/op
    
    I also tried making a version of escape() that writes directly to the
    bytes.Buffer, but it only saved 1 alloc/op and increased CPU time by
    about 10%. Didn't seem worth the extra code path.
    
    R=bradfitz
    CC=golang-dev
    https://golang.org/cl/7182050
    da82dfac
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...