This repository has been archived by the owner on Sep 1, 2023. It is now read-only.
forked from connectrpc/connect-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minimize allocations writing User-Agent header (connectrpc#446)
The fmt.Sprintf stood out again in my profiling as a relatively hot path, and through the lifetime of an application, this value will not change. So we can generate this header value at init() time and avoid the extra memory allocation as well on each request. **Before submitting your PR:** Please read through the contribution guide at https://github.com/bufbuild/connect-go/blob/main/.github/CONTRIBUTING.md
- Loading branch information
1 parent
cb460f1
commit 4c2c9a9
Showing
2 changed files
with
18 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters