Skip to content

go: use UTF8DecodeInvalid in fxamacker/cbor wrapper - #80

Open
fxamacker wants to merge 1 commit into
leo-gan:masterfrom
fxamacker:fxamacker-cbor-wrapper-review
Open

go: use UTF8DecodeInvalid in fxamacker/cbor wrapper#80
fxamacker wants to merge 1 commit into
leo-gan:masterfrom
fxamacker:fxamacker-cbor-wrapper-review

Conversation

@fxamacker

Copy link
Copy Markdown

This PR uses a decoding option to disable UTF-8 validation because generated fixtures are valid UTF-8 and trusted. Skipping UTF-8 validation improves decoding speed by 2-12%, depending on string content.

Other changes:

  • correct a comment about CoreDet
  • fix a broken link in a comment
  • add a comment to mention fxamacker/cbor provides toarray and keyasint struct tag options that can further improve performance and reduce encoded size if they are added to Go structs in the benchmark file (model/v2/generate.go)

This commit uses a decoding option to disable UTF-8 validation
because generated fixtures are valid UTF-8 and trusted.
Skipping UTF-8 validation improves decoding speed by 2-12%,
depending on string content.

Other changes:
- correct a comment about CoreDet
- fix a broken link in a comment
- add a comment to mention fxamacker/cbor provides toarray and
  keyasint struct tag options that can further improve performance
  and reduce encoded size if they are added to Go structs in the
  benchmark file (model/v2/generate.go)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant