-
Notifications
You must be signed in to change notification settings - Fork 60
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
Improve decoding speed #47
Labels
Milestone
Comments
@fxamacker Thanks. v2.0 is going to be faster than v1.5, so it makes sense to move this to v2.1. |
16 tasks
fxamacker
added a commit
that referenced
this issue
Feb 13, 2020
CBOR tag support includes: - API to use TagSet to register user-defined Go type with CBOR tag number. - API to encode Go value with CBOR tag number without registering. - API to extract CBOR tag number with Tag or RawTag structs. - API to use immutable TagSet or mutable shared TagSet (shared tag registry). - EncOptions/DecOptions settings to tag or not tag time.Time values. Improved decoding speed and memory for "keyasint" struct (COSE, CWT, etc.): - speed is faster by 24% - 28%. - mem allocs is reduced by 44% - 61%. - mem bytes is reduced by 13% - 26%. Encoding is a bit slower around 2% - 4% because of added features. Optimization of encoding can be tackled in future releases because it is still very fast. TagSet is a Go interface to register tag support for user-defined Go types. EncMode and DecMode are reusable interfaces that are safe for concurrency. They export codec functions with identical signatures to encoding/json. EncMode can be created by these functions: EncOptions{...}.EncMode() EncOptions{...}.EncModeWithTags(TagSet) EncOptions{...}.EncModeWithSharedTags(TagSet) DecMode can be created by these functions: DecOptions{...}.DecMode() DecOptions{...}.DecModeWithTags(TagSet) DecOptions{...}.DecModeWithSharedTags(TagSet) Tag and RawTag are structs used to encode/decode CBOR tag number with tag content. See docs for more details. Closed: #44 Closed: #47 Closed: #125 Closed: #147
12 tasks
fxamacker
added a commit
that referenced
this issue
Feb 15, 2020
CBOR tag support includes: - API to use TagSet to register user-defined Go type with CBOR tag number. - API to encode Go value with CBOR tag number without registering. - API to extract CBOR tag number with Tag or RawTag structs. - API to use immutable TagSet or mutable shared TagSet (shared tag registry). - EncOptions/DecOptions settings to tag or not tag time.Time values. Improved decoding speed and memory for "keyasint" struct (COSE, CWT, etc.): - speed is faster by 24% - 28%. - mem allocs is reduced by 44% - 61%. - mem bytes is reduced by 13% - 26%. Encoding is a bit slower around 2% - 4% because of added features. Optimization of encoding can be tackled in future releases because it is still very fast. TagSet is a Go interface to register tag support for user-defined Go types. EncMode and DecMode are reusable interfaces that are safe for concurrency. They export codec functions with identical signatures to encoding/json. EncMode can be created by these functions: EncOptions{...}.EncMode() EncOptions{...}.EncModeWithTags(TagSet) EncOptions{...}.EncModeWithSharedTags(TagSet) DecMode can be created by these functions: DecOptions{...}.DecMode() DecOptions{...}.DecModeWithTags(TagSet) DecOptions{...}.DecModeWithSharedTags(TagSet) Tag and RawTag are structs used to encode/decode CBOR tag number with tag content. See docs and closed issues for more details. Closed: #44 Closed: #47 Closed: #125 Closed: #147 Closed: #151
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Spotted several optimizations while working on milestone v1.3.1.
Speedups should be around 4% or 5% faster for COSE and CWT decoding depending on other changes in the same release.
The text was updated successfully, but these errors were encountered: