Skip to content

bench: add protobuf storage overhead benchmark - #151

Merged
kacy merged 1 commit into
mainfrom
bench/protobuf-benchmark
Feb 15, 2026
Merged

bench: add protobuf storage overhead benchmark#151
kacy merged 1 commit into
mainfrom
bench/protobuf-benchmark

Conversation

@kacy

@kacy kacy commented Feb 15, 2026

Copy link
Copy Markdown
Owner

summary

  • new bench-proto.sh, bench-proto.py, and bench/proto/user.proto
  • compares PROTO.SET vs raw SET and PROTO.GET vs raw GET to measure schema validation overhead
  • also benchmarks PROTO.GETFIELD (single field read) and PROTO.SETFIELD (single field update)
  • computes and reports overhead percentage
  • hand-rolls protobuf wire encoding in python to avoid runtime protobuf library dependency
  • supports --quick flag for 10k-request sanity checks

what was tested

  • verified hand-rolled protobuf encoding matches the User message schema
  • confirmed protoc compilation produces valid FileDescriptorSet
  • reviewed command flow: compile → register → encode → SET/GET

design considerations

  • hand-rolled encoding avoids the protobuf pip dependency but only supports the simple User schema. the full protobuf library would be needed for complex nested messages.
  • protoc is required at runtime for --descriptor_set_out — this is consistent with how ember's PROTO.REGISTER works (expects compiled descriptors, not raw .proto text)

new benchmark comparing PROTO.* commands against raw SET/GET:

- bench-proto.sh: shell wrapper (requires --features protobuf, protoc)
- bench-proto.py: python harness using redis-py
- bench/proto/user.proto: simple test schema (name/age/email)

measures:
- PROTO.SET vs raw SET (same data, validated vs raw bytes)
- PROTO.GET vs raw GET
- PROTO.GETFIELD single-field read throughput
- PROTO.SETFIELD single-field update throughput
- overhead percentage for schema validation

proto encoding is hand-rolled in python to avoid requiring the
protobuf library at benchmark runtime. schema compilation uses
protoc --descriptor_set_out at startup.
@kacy
kacy merged commit 37b3e4e into main Feb 15, 2026
7 checks passed
@kacy
kacy deleted the bench/protobuf-benchmark branch February 15, 2026 13:14
kacy added a commit that referenced this pull request Feb 19, 2026
new benchmark comparing PROTO.* commands against raw SET/GET:

- bench-proto.sh: shell wrapper (requires --features protobuf, protoc)
- bench-proto.py: python harness using redis-py
- bench/proto/user.proto: simple test schema (name/age/email)

measures:
- PROTO.SET vs raw SET (same data, validated vs raw bytes)
- PROTO.GET vs raw GET
- PROTO.GETFIELD single-field read throughput
- PROTO.SETFIELD single-field update throughput
- overhead percentage for schema validation

proto encoding is hand-rolled in python to avoid requiring the
protobuf library at benchmark runtime. schema compilation uses
protoc --descriptor_set_out at startup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant