dep-protobuf/upb
Protobuf Team Bot bbe3b9e4f2 Handle return values in cpp code in upb/hpb
PiperOrigin-RevId: 956112101
2026-07-29 15:12:49 -07:00
..
base upb: Adds a new error code kUpb_ErrorCode_MaxDepthExceeded. 2026-05-29 09:59:31 -07:00
bazel Add Kythe indexing support to HPB proto in C++ 2026-06-10 11:24:41 -07:00
cmake Added debug printing for MiniTables. 2025-10-24 20:11:37 -07:00
conformance Add conformance tests for Timestamp parsing 2026-07-27 06:54:18 -07:00
hash Second batch of ignored return value fixes; caught an off-by-one bounds check in the JSON benchmark 2026-06-29 19:45:53 -07:00
json Handle return values in cpp code in upb/hpb 2026-07-29 15:12:49 -07:00
lex Remove unused upb _upb_NoLocaleStrtod (Google Bug Hunters VRP) (#26377) 2026-06-25 12:23:47 -07:00
mem Don't enforce that the return value of upb_Arena_Fuse is used; this only fails if an initial block is in use, and in that case it's reasonable to assume that the program is managing those lifetimes manually. 2026-07-29 13:39:58 -07:00
message Handle return values in cpp code in upb/hpb 2026-07-29 15:12:49 -07:00
mini_descriptor Disable fasttable when executing 32bit decoder on 64bit cpu. 2026-07-27 23:15:59 -07:00
mini_table Internal change 2026-06-29 12:35:21 -07:00
port Add volatile to init_array asm 2026-07-20 15:56:58 -07:00
reflection Handle return values in cpp code in upb/hpb 2026-07-29 15:12:49 -07:00
test Handle return values in cpp code in upb/hpb 2026-07-29 15:12:49 -07:00
text Delete array part of inttable, reducing complexity 2026-05-06 17:00:23 -07:00
util Handle return values in cpp code in upb/hpb 2026-07-29 15:12:49 -07:00
wire Support non-canonical extensions in message copy/freeze/encode operations. 2026-07-28 08:04:18 -07:00
BUILD Add new upb_Message_NextUnknown2 and upb_Message_DeleteUnknown2 functions to support non-canonical extensions in unknown field iteration/deletion. 2026-07-05 19:52:56 -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.