dep-protobuf/upb
2026-08-25 20:13:17 -07:00
..
base upb: Adds a new error code kUpb_ErrorCode_MaxDepthExceeded. 2026-05-29 09:59:31 -07:00
bazel Enable FastTable for non-opt builds. 2026-08-20 13:10:05 -07:00
cmake protobuf: improve staleness test regeneration to reduce confusion 2026-08-11 21:03:35 -07:00
conformance Update conformance tests with updated relaxed duplicate key handling in ProtoJSON 2026-08-02 09:58:52 -07:00
hash Introduce overflow checking functions for add and multiply in upb to replace error-prone manual checks 2026-08-17 17:17:05 -07:00
json Introduce overflow checking functions for add and multiply in upb to replace error-prone manual checks 2026-08-17 17:17:05 -07:00
lex Remove unused upb _upb_NoLocaleStrtod (Google Bug Hunters VRP) (#26377) 2026-06-25 12:23:47 -07:00
mem Hopefully final batch of return value checks before UPB_NODISCARD enforcement 2026-08-25 20:13:17 -07:00
message Hopefully final batch of return value checks before UPB_NODISCARD enforcement 2026-08-25 20:13:17 -07:00
mini_descriptor Introduce overflow checking functions for add and multiply in upb to replace error-prone manual checks 2026-08-17 17:17:05 -07:00
mini_table Enable FastTable for non-opt builds. 2026-08-20 13:10:05 -07:00
port Enable FastTable for non-opt builds. 2026-08-20 13:10:05 -07:00
reflection Add allocation failure tests for unknowns and defbuilder 2026-08-19 13:46:43 -07:00
test upb/message/compare: Add support for partial equality comparisons 2026-08-12 08:53:40 -07:00
text Support printing non-canonical extensions in the text encoder. 2026-08-19 21:20:45 -07:00
util fix missed oom handling in unset required 2026-07-30 10:42:17 -07:00
wire Hopefully final batch of return value checks before UPB_NODISCARD enforcement 2026-08-25 20:13:17 -07:00
BUILD Enable FastTable for non-opt builds. 2026-08-20 13:10:05 -07:00
generated_code_support.h Automated rollback of commit efacad9581. 2025-11-18 15:24:59 -08:00
README.md Fixed broken link in upb README.md (#16717) 2024-05-14 08:34:33 -07:00

μpb: small, fast C protos

μpb (often written 'upb') is a small protobuf implementation written in C.

upb is the core runtime for protobuf languages extensions in Ruby, PHP, and Python.

While upb offers a C API, the C API & ABI are not stable. For this reason, upb is not generally offered as a C library for direct consumption, and there are no releases.

Features

upb has comparable speed to protobuf C++, but is an order of magnitude smaller in code size.

Like the main protobuf implementation in C++, it supports:

  • a generated API (in C)
  • reflection
  • binary & JSON wire formats
  • text format serialization
  • all standard features of protobufs (oneofs, maps, unknown fields, extensions, etc.)
  • full conformance with the protobuf conformance tests

upb also supports some features that C++ does not:

  • optional reflection: generated messages are agnostic to whether reflection will be linked in or not.
  • no global state: no pre-main registration or other global state.
  • fast reflection-based parsing: messages loaded at runtime parse just as fast as compiled-in messages.

However there are a few features it does not support:

  • text format parsing
  • deep descriptor verification: upb's descriptor validation is not as exhaustive as protoc.

Install

For Ruby, use RubyGems:

$ gem install google-protobuf

For PHP, use PECL:

$ sudo pecl install protobuf

For Python, use PyPI:

$ sudo pip install protobuf

Alternatively, you can build and install upb using vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install upb

The upb port in vcpkg is kept up to date by microsoft team members and community contributors.

If the version is out of date, please create an issue or pull request on the vcpkg repository.

Contributing

Please see CONTRIBUTING.md.