net/http/internal/http2: optimize Date header generation#79913
Conversation
… cache Replace the per-request time.Now().UTC().Format() call in writeChunk with a cached string that updates at most once per UTC second. This eliminates redundant time formatting overhead in high-concurrency HTTP/2 workloads.
|
This PR (HEAD: 48fbc8e) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/788660. Important tips:
|
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/788660. |
|
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/788660. |
Replace the per-request time.Now().UTC().Format() call
in writeChunk with a cached string that updates at most
once per UTC second.
This eliminates redundant time formatting overhead in
high-concurrency HTTP/2 workloads by using an atomic
cache for the formatted date string.
Fixes #79914