• Meir Fischer's avatar
    http2: remove unnecessary TODO for trailer keys allocation · 69d4b8aa
    Meir Fischer authored
    strings.Join has two allocations:
    (1) []byte intermediate
    (2) final string conversion
    The comma-separated keys are ultimately stored in hpack.HeaderField.Value
    as a string so (2) is not wasteful. Because strings.Join is used so heavily
    I assume its implementation is optimal - (1) is necessary.
    Therefore, short of refactoring hpack.HeaderField's Value type, the status quo
    seems optimal.
    
    This TODO appears to have been copy-pasted from net/http/transfer.go
    However, the two cases are different. transfer.go has two allocations
    in addition to strings.Join: concatenation with literals and converting
    string to bytes in io.WriteString.
    
    Change-Id: I292203a6535dd2774f5bf45e7280b89aabb5d78d
    Reviewed-on: https://go-review.googlesource.com/34626Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    69d4b8aa
Name
Last commit
Last update
bpf Loading commit data...
context Loading commit data...
dict Loading commit data...
html Loading commit data...
http2 Loading commit data...
icmp Loading commit data...
idna Loading commit data...
internal Loading commit data...
ipv4 Loading commit data...
ipv6 Loading commit data...
lex/httplex Loading commit data...
lif Loading commit data...
nettest Loading commit data...
netutil Loading commit data...
proxy Loading commit data...
publicsuffix Loading commit data...
route Loading commit data...
trace Loading commit data...
webdav Loading commit data...
websocket Loading commit data...
xsrftoken Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
codereview.cfg Loading commit data...