RepositoryC++JPJapan
ar90n

ar90n/msgpack11

A tiny MessagePack library for C++11 (msgpack.org[C++11])

133stars
38forks
4issues
2views

Build Issues MIT

What is msgpack11 ?

msgpack11 is a tiny MsgPack library for C++11, providing MsgPack parsing and serialization.
This library is inspired by json11.
The API of msgpack11 is designed to be similar with json11.

Installation

  • Using CMake

      git clone git@github.com:ar90n/msgpack11.git
      mkdir build
      cd build
      cmake ../msgpack11
      make && make install
    
  • Using Buck

      git clone git@github.com:ar90n/msgpack11.git
      cd msgpack11
      buck build :msgpack11
    

Example

MsgPack my_msgpack = MsgPack::object {
    { "key1", "value1" },
    { "key2", false },
    { "key3", MsgPack::array { 1, 2, 3 } },
};

//access to elements
std::cout << my_msgpack["key1"].string_value();

//serialize
std::string msgpack_bytes = my_msgpack.dump();

//deserialize
std::string err;
MsgPack des_msgpack = MsgPack::parse(msgpack_bytes, err);

There are more specific examples in example.cpp. Please see it.

Benchmark

Derived from schemaless-benchmarks

LibraryBinary sizetime[ms] @ Smallesttime[ms] @ Smalltime[ms] @ Mediumtime[ms] @ Largetime[ms] @ Largest
msgpack-c-pack(v2.1.4)66490.552.3843.22711.758748.20
msgpack-c-unpack(v2.1.4)218041.346.0083.09714.6411192.32
msgpack11-pack(v0.0.9)9984420.80130.041063.2410466.65136640.99
msgpack11-unpack(v0.0.9)9946013.3192.54786.737345.4399119.56

CPU : 2.6 GHz Intel Core i7
Memory : 16 GB 2133 MHz LPDDR3
Git revision : 6f6b4302b68b3c88312eb24367418b7fce81298c

Feature

  • Support serialization and deserialization.

Acknowledgement

License

This software is released under the MIT License, see LICENSE.txt.

Similar Projects

Discover other similar projects and AI models.

RepositoryC#
MessagePack-CSharp/MessagePack-CSharp

Extremely Fast MessagePack Serializer for C#(.NET, .NET Core, Unity, Xamarin). / msgpack.org[C#]

6.8k
Nov 20, 2026
RepositoryPython
msgspec/msgspec

A fast serialization and validation library, with builtin support for JSON, MessagePack, YAML, and TOML

4.2k
Dec 1, 2026
RepositoryRust
3Hren/msgpack-rust

MessagePack implementation for Rust / msgpack.org[Rust]

1.4k
Dec 23, 2025
RepositoryC++
rwindegger/msgpack23

A modern, header-only C++ library for MessagePack serialization and deserialization. msgpack.org[c++23]

99
Sep 21, 2026
RepositoryC
ludocode/mpack

MPack - A C encoder/decoder for the MessagePack serialization format / msgpack.org[C]

640
Nov 8, 2026
RepositoryPython
remarshal-project/remarshal

Convert between CBOR, JSON, MessagePack, TOML, and YAML 1.1 & 1.2

554
Aug 1, 2026
RepositoryPHP
rybakit/msgpack.php

A pure PHP implementation of the MessagePack serialization format / msgpack.org[PHP]

406
Nov 26, 2026
RepositoryJavaScript
ygoe/msgpack.js

A minimal yet complete MessagePack implementation for JavaScript. msgpack.org[JavaScript]

165
May 10, 2024
RepositoryJulia
JuliaIO/MsgPack.jl

Julia MessagePack implementation with type-driven, overloadable packing/unpacking functionality // msgpack.org[Julia]

68
Nov 22, 2026