• Home
Name Date Size #Lines LOC

..--

base/22-Oct-2025-509319

bazel/22-Oct-2025-308228

cmake/22-Oct-2025-10,7569,965

conformance/22-Oct-2025-497421

hash/22-Oct-2025-1,5471,053

io/22-Oct-2025-3,4292,328

json/22-Oct-2025-2,8782,319

lex/22-Oct-2025-585365

mem/22-Oct-2025-1,323885

message/22-Oct-2025-8,6216,408

mini_descriptor/22-Oct-2025-2,5971,977

mini_table/22-Oct-2025-1,7341,096

port/22-Oct-2025-677571

reflection/22-Oct-2025-23,17420,608

test/22-Oct-2025-2,1551,733

text/22-Oct-2025-1,159847

util/22-Oct-2025-2,2471,755

wire/22-Oct-2025-4,7223,630

BUILDD22-Oct-202510.3 KiB429383

README.mdD22-Oct-20252.3 KiB8559

generated_code_support.hD22-Oct-20251.2 KiB3523

README.md

1
2# μpb: small, fast C protos
3
4μpb (often written 'upb') is a small
5[protobuf](https://github.com/protocolbuffers/protobuf) implementation written
6in C.
7
8upb is the core runtime for protobuf languages extensions in
9[Ruby](https://github.com/protocolbuffers/protobuf/tree/main/ruby),
10[PHP](https://github.com/protocolbuffers/protobuf/tree/main/php), and
11[Python](https://github.com/protocolbuffers/protobuf/tree/main/python).
12
13While upb offers a C API, the C API & ABI **are not stable**. For this reason,
14upb is not generally offered as a C library for direct consumption, and there
15are no releases.
16
17## Features
18
19upb has comparable speed to protobuf C++, but is an order of magnitude smaller
20in code size.
21
22Like the main protobuf implementation in C++, it supports:
23
24- a generated API (in C)
25- reflection
26- binary & JSON wire formats
27- text format serialization
28- all standard features of protobufs (oneofs, maps, unknown fields, extensions,
29  etc.)
30- full conformance with the protobuf conformance tests
31
32upb also supports some features that C++ does not:
33
34- **optional reflection:** generated messages are agnostic to whether
35  reflection will be linked in or not.
36- **no global state:** no pre-main registration or other global state.
37- **fast reflection-based parsing:** messages loaded at runtime parse
38  just as fast as compiled-in messages.
39
40However there are a few features it does not support:
41
42- text format parsing
43- deep descriptor verification: upb's descriptor validation is not as exhaustive
44  as `protoc`.
45
46## Install
47
48For Ruby, use [RubyGems](https://rubygems.org/gems/google-protobuf):
49
50```
51$ gem install google-protobuf
52```
53
54For PHP, use [PECL](https://pecl.php.net/package/protobuf):
55
56```
57$ sudo pecl install protobuf
58```
59
60For Python, use [PyPI](https://pypi.org/project/protobuf/):
61
62```
63$ sudo pip install protobuf
64```
65
66Alternatively, you can build and install upb using
67[vcpkg](https://github.com/microsoft/vcpkg/) dependency manager:
68
69    git clone https://github.com/Microsoft/vcpkg.git
70    cd vcpkg
71    ./bootstrap-vcpkg.sh
72    ./vcpkg integrate install
73    ./vcpkg install upb
74
75The upb port in vcpkg is kept up to date by microsoft team members and community
76contributors.
77
78If the version is out of date, please
79[create an issue or pull request](https://github.com/Microsoft/vcpkg) on the
80vcpkg repository.
81
82## Contributing
83
84Please see [CONTRIBUTING.md](CONTRIBUTING.md).
85