Open YHM404 opened 3 months ago
Related Issues and Documentation
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
CC @neild @bradfitz
There's no need for a user-configurable option here. If there are performance improvements that can be made to frame decoding in the HTTP/2 implementation, we can just make them.
There's no need for a user-configurable option here. If there are performance improvements that can be made to frame decoding in the HTTP/2 implementation, we can just make them.
I will conduct a performance comparison and, if everything looks good, I will submit a pull request.
I have conducted a simple benchmark, and the results show that SetReuseFrames
significantly improves the performance of parseDataFrame
.
Running tool: /usr/local/bin/go test -benchmem -run=^$ -bench ^BenchmarkParseDataFramesWithoutReuse$ golang.org/x/net/http2
goos: darwin
goarch: amd64
pkg: golang.org/x/net/http2
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
BenchmarkParseDataFramesWithoutReuse-12 31313877 39.03 ns/op 48 B/op 1 allocs/op
Running tool: /usr/local/bin/go test -benchmem -run=^$ -bench ^BenchmarkParseDataFrames$ golang.org/x/net/http2
goos: darwin
goarch: amd64
pkg: golang.org/x/net/http2
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
BenchmarkParseDataFrames-12 143745076 8.167 ns/op 0 B/op 0 allocs/op
PASS
ok golang.org/x/net/http2 2.413s
Proposal Details
I noticed a issue about
SetReuseFrames
https://github.com/golang/go/issues/18502I would like to propose the addition of a configuration option to enable or disable
SetReuseFrames
in the HTTP2 server and HTTP2 transport.SetReuseFrames
has been shown to improve the performance of go-grpc, so I believe it can similarly enhance the performance of HTTP server/client.By adding this configuration option, users can choose to enable frame reuse based on their performance needs and use cases.
Thank you for considering this feature request.