-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/net/http2: improve frame decoding performance by reusing frames #68352
Comments
Related Issues and Documentation (Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
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 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
#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.
The text was updated successfully, but these errors were encountered: