-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
codec: perf: make common-path of bytesEncWriter.grow inlineable
Most requests to grow for a bytesEncWriter will either move the cursor or expand the length to the cap of the []byte. Put this in a different method that can be inlined, and only call out to the growCap method if an allocation is necessary. Makes encode for a []byte about 8% faster in microbenchmarks.
- Loading branch information
Showing
2 changed files
with
40 additions
and
37 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