google-protobuf is 11-101x faster -- this is expected since it uses a compiled C/upb backend while zerodep is pure Python. The gap widens with message complexity.
Decode is relatively closer -- zerodep's decode gap (15-101x) is smaller than encode (11-67x) in absolute terms, but encode has been optimized more aggressively in recent releases.
zerodep targets a different use case -- the tradeoff is zero dependencies, no protoc, no .proto files, no C extensions, and a single-file drop-in. It is suitable for:
Configuration and metadata exchange (low frequency)
CLI tools, scripts, and prototyping
Environments where C extensions are unavailable
Projects that need proto3 wire compatibility without the build toolchain
Small messages at ~2.5 μs encode -- fast enough for per-request metadata or RPC headers at high throughput (~400K ops/s).
Dict conversion has no google equivalent -- to_dict() / from_dict() provide JSON-friendly serialization without MessageToDict overhead.
byte_size() without serialization -- compute the serialized message size without allocating bytes, useful for protocol framing and buffer pre-allocation.