-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve encoding speed, reduce mem, refactor
Speed/mem improvements: - Replace range loop with for loop to avoid mem copy when encoding struct. - Change encodeState's scratch field from [64]byte to [16]byte. - Change and reorder "field" struct's fields to reduce struct size. Refactor: - Rename varaibles and functions. - Decouple encoding struct type cache and decoding struct type cache. - Others. benchmark old ns/op new ns/op delta BenchmarkMarshal/Go_struct_to_CBOR_map-2 828 728 -12.08%
- Loading branch information
Showing
3 changed files
with
67 additions
and
81 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
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