Get the latest tech news

Parsing Protobuf like never before


Historically I have worked on many projects related to high-performance Protobuf, be that on the C++ runtime, on the Rust runtime, or on integrating UPB, the fastest Protobuf runtime, written by my colleague Josh Haberman. I generally don’t post directly about my current job, but my most recent toy-turned-product is something I’m very excited to write about: hyperpb.

This presents a few issues though, particularly because Go’s assembly calling convention is still in the stone age (arguments are passed on the stack), and because we would still need to do a lot of work to get UPB to match the protoreflect API. Also, the Go ecosystem seems much more tolerant of less-than-ideal startup times (because the language loves life-before-main due to init() functions), so unlike UPB, we can require that the interpreter’s program be generated at runtime, meaning that we can design for online PGO. This means that selecting one of ~100 alternatives using branches, even if they are well-predicted and you use unrolled binary search, is still likely to result in frequent mispredictions, and is an obstacle to other JIT optimizations in the processor’s backend.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Protobuf

Protobuf

Related news:

News photo

Hyperpb: Faster dynamic Protobuf parsing that's faster than generated code

News photo

Go Protobuf: The New Opaque API

News photo

Show HN: An Elliptic Curve-Based Secure Chat, Written Using Rust and Protobuf