Skip to content

Efficient way of CBOR serializing big chunk of binary data #2520

Answered by nlohmann
Jamaslab asked this question in Q&A
Discussion options

You must be logged in to vote

The from_cbor function is parsing the binary input and creates a JSON representation in memory. If you don't need it, you can implement your own SAX parser and decide what happens with the values coming from the parser.

And: did you try to compile with optimizations? Running the code on my MacBook Pro with -O3, I get

Assign: 40 us
Serialize: 26668 us
Deserialize: 60489 us

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@epvbergen
Comment options

@nlohmann
Comment options

@Jamaslab
Comment options

Answer selected by Jamaslab
Comment options

You must be logged in to vote
1 reply
@nlohmann
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