opt in to frame reuse on the framer to reduce garbage (#1096)
This commit is contained in:
@ -383,6 +383,9 @@ func newFramer(conn net.Conn) *framer {
|
|||||||
writer: bufio.NewWriterSize(conn, http2IOBufSize),
|
writer: bufio.NewWriterSize(conn, http2IOBufSize),
|
||||||
}
|
}
|
||||||
f.fr = http2.NewFramer(f.writer, f.reader)
|
f.fr = http2.NewFramer(f.writer, f.reader)
|
||||||
|
// Opt-in to Frame reuse API on framer to reduce garbage.
|
||||||
|
// Frames aren't safe to read from after a subsequent call to ReadFrame.
|
||||||
|
f.fr.SetReuseFrames()
|
||||||
f.fr.ReadMetaHeaders = hpack.NewDecoder(http2InitHeaderTableSize, nil)
|
f.fr.ReadMetaHeaders = hpack.NewDecoder(http2InitHeaderTableSize, nil)
|
||||||
return f
|
return f
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user