Protobuf VS MessagePack

Compare Protobuf vs MessagePack and see what are their differences.

MessagePack

MessagePack implementation for C and C++ / msgpack.org[C/C++] (by msgpack)
JetBrains - Tell us how you use coding tools. You may win a prize!
Are you a developer or a data analyst? Share your thoughts about your coding tools in our short survey and get a chance to win prizes!
surveys.jetbrains.com
featured
InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com
featured
Protobuf MessagePack
200 2
68,919 3,193
1.5% 1.1%
10.0 0.0
2 days ago about 1 month ago
C++
GNU General Public License v3.0 or later GNU General Public License v3.0 or later
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

Protobuf

Posts with mentions or reviews of Protobuf. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2025-07-24.
  • I wasted weeks hand optimizing assembly because I benchmarked on random data
    2 projects | news.ycombinator.com | 24 Jul 2025
    (((uint32_t)clz + 7) * 9) >> 6

    3. Hand roll a jump table taking advantage of arm's fixed instruction width to calculate the jump target with a shift.

    https://github.com/protocolbuffers/protobuf/commit/b039dfe26...

    This results in one branch for 1 byte varints, plus one additional branch for any larger size, and the branch predictor does not have to track a varying trip count through a loop. This approach resulted in a 2.64% speedup for overall encoding (which includes a lot more than just varints) on mid sized arm cores.

    I think it's very difficult to beat a single comparison and branch for the 1 byte case for actual encoding forwards or backwards, unless you know there's going to be long runs of one-byte values.

  • C++: zero-cost static initialization
    2 projects | news.ycombinator.com | 18 Jul 2025
    I wrote a portable abstraction for this that works across Linux, MacOS, and Windows: https://github.com/protocolbuffers/protobuf/blob/4917ec250d3...

    I call them "linker arrays". They are great when you need to globally register a set of things and the order between them isn't significant.

  • Parsing Protobuf Like Never Before
    5 projects | news.ycombinator.com | 17 Jul 2025
    This kind of "expected next field" optimization has a long history in protobuf, but results are mixed.

    The generated code in C++ used to check for the expected next field before falling back to the switch() (example here: https://github.com/protocolbuffers/protobuf/blob/460e7dd7c47...) but this was removed in 2016 when tests found that it hurt more than it helped.

    One tricky part of making this optimization work is making a good guess about what the next field should be. Miguel's article alludes to this:

    > Each field specifies which fields to try next. This allows the compiler to perform field scheduling, by carefully deciding which order to try fields in based both on their declaration order and a rough estimation of their “hotness”, much like branch scheduling happens in a program compiler. This avoids almost all of the work of looking up the next field in the common case, because we have already pre-loaded the correct guess.

    > I haven’t managed to nail down a good algorithm for this yet, but I am working on a system for implementing a type of “branch prediction” for PGO, that tries to provide better predictions for the next fields to try based on what has been seen before.

    One delightful thing about the tail-call parser design is that the CPU's branch predictor effectively takes over the job of guessing. With a tail call parser, the dispatch sequence ends up looking like this:

        cmp    QWORD PTR [rdi+0x8],rsi               # Bounds check
  • Show HN: BinaryRPC – Lightweight WebSocket-based RPC framework in modern C++
    5 projects | news.ycombinator.com | 12 Jul 2025
    > Would be great if you report such remote code executions to the authors/Google. I am sure they handle CVEs etc.

    I wasn't getting paid to fix their code, I have no interest in helping Google for free, and don't want to help Google.

    > There has been a security audit like

    A checkbox report from six years ago. That's ancient times at the pace that things are added to gRPC.

    > Are you making shit up as you go?

    No. This [0] repo I used to reproduce a stack smash issue before `main()`. I reported the issue here [1]. I don't get paid to fix Google's things and found a workaround for the purposes I needed.

    [0]: https://github.com/keith-bennett-airmap/grpc-stacksmash

    [1]: https://github.com/protocolbuffers/protobuf/issues/12732

    > I can see various fuzzers in the code base so that claim is also unsubstantiated

    Fuzzers are cool, but they don't cover the whole codebase.

  • The provenance memory model for C
    2 projects | news.ycombinator.com | 30 Jun 2025
    This is doable via this trick:

    https://github.com/protocolbuffers/protobuf/blob/ae0129fcd01...

  • Getting Started With gRPC in Golang
    2 projects | dev.to | 3 Apr 2025
    Install the protoc compiler manually from here and add it to your PATH.
  • Ruby, Ractors, and Lock-Free Data Structures
    4 projects | news.ycombinator.com | 25 Mar 2025
    We wanted to use Ractors in our latest Ruby project (which is Rust based using rb-sys/magnus for some parts), but since our users use Google Protobuf inside the code that may run in Ractors, we could not because the library is not Ractor safe[0] (and it's unreasonable for us to ask our users to not be able to use the official Protobuf library).

    0 - https://github.com/protocolbuffers/protobuf/issues/19321

  • Sign in as anyone: Bypassing SAML SSO authentication with parser differentials
    3 projects | news.ycombinator.com | 15 Mar 2025
    For Java, I think you mean Jackson, not gson, unless something has changed recently. Goes to show that even the behemoths can get this wrong.

    https://github.com/protocolbuffers/protobuf/blob/6aefdde9736...

  • The Big TDD Misunderstanding (2022)
    1 project | news.ycombinator.com | 16 Feb 2025
  • Try Postgres Cloud
    8 projects | dev.to | 19 Jan 2025
    Building Neon requires 3.15+ version of protoc (protobuf-compiler). If your distribution provides an older version, you can install a newer version from here.

MessagePack

Posts with mentions or reviews of MessagePack. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-04-15.

What are some alternatives?

When comparing Protobuf and MessagePack you can also consider the following projects:

FlatBuffers - FlatBuffers: Memory Efficient Serialization Library

SBE - Simple Binary Encoding (SBE) - High Performance Message Codec

Boost.Serialization - Boost.org serialization module

cereal - A C++11 library for serialization

JetBrains - Tell us how you use coding tools. You may win a prize!
Are you a developer or a data analyst? Share your thoughts about your coding tools in our short survey and get a chance to win prizes!
surveys.jetbrains.com
featured
InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com
featured

Did you know that C++ is
the 7th most popular programming language
based on number of references?