Skip to content

Different values of pack #68

Answered by kriszyp
ahmads-dy asked this question in Q&A
May 25, 2022 · 3 comments · 5 replies
Discussion options

You must be logged in to vote

Yes, when you use the Packr constructor to create a encoder/decoder instance via new Packr this defaults to enabling the record extension, which for larger objects should be more compact and faster. However, for compatibility with other MessagePack encoders, you should disable that, either using new Packr({useRecords: false}), or directly using the exported unpack/pack (import { pack, unpack } from 'msgpackr'). For trying to match other libraries byte for byte, you may also want to use new Packr({useRecords: false, variableMapSize: true}), to have minimal object header size (slightly slower, but slightly less compact).

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by ahmads-dy
Comment options

You must be logged in to vote
4 replies
@kriszyp
Comment options

@ahmads-dy
Comment options

@gonenduk-dy
Comment options

@kriszyp
Comment options

Comment options

You must be logged in to vote
1 reply
@kriszyp
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants