Skip to content

Use MsgPack bin instead of base64 #2

@drewcrawford

Description

@drewcrawford

I maintain probably what is the only reasonable MsgPack library for ObjC (and, soon, Swift). I also support a large number of what you call "extension types", but in my case they go way beyond primitive types like URLs/dates into things like custom classes. What I'm saying is, I have spent a lot of time in this problem space.

To me the advantage of a non-JSON scheme is performance. Sure, you could define a set of extensions just for JSON, but why do that when alternate encoders like MsgPack are so much more efficient for non-JS implementations. We're on the same page there.

However, the decision of base64ing the bytes is a complete non-starter for me. It bloats the size and takes longer in transit, longer to encode/decode, etc. MsgPack v2 has a perfectly adequate, binary, non-string type for you to target. Efficient transport of byte arrays is actually the thing that motivated me to write an MsgPack library in the first place.

Sure, it means you have a difference between JSON/MsgPack representations but that's already the case for other types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions