-
-
InfluxDB
InfluxDB – Built for High-Performance Time Series Workloads. InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
-
vtprotobuf
A Protocol Buffers compiler that generates optimized marshaling & unmarshaling Go code for ProtoBuf APIv2
Hi HN,
protobuf-go is a widely used binary serialization library and IDL for protobuf in Go. The upstream library leverages reflection to provide a wide variety of features which are useful in a server context.
Go is increasingly being used for resource-constrained environments like embedded (tinygo) and WebAssembly. In these environments, reflection is not always available, and when it is, it adds significant weight to the binary size.
vtprotobuf: https://github.com/planetscale/vtprotobuf - compiles static code generation for Protobufs in go, including functions to marshal, unmarshal, size, clone, messages. However, it still requires protobuf-go and the reflection-based code for the message structs.
protobuf-go-lite takes this one step further with a stripped-down version of the protobuf-go code generator modified to work without reflection and merged with vtprotobuf to provide modular features with static code generation for marshal/unmarshal, size, clone, and equal. It bundles a fork of protoc-gen-go-json for JSON support.
It has already been used (experimentally) for a reflection-free version of OpenTelemetry for Go: https://github.com/gburek-fastly/opentelemetry-proto-go/pull... as well as other projects at Aperture Robotics.
Thanks & have a great Friday!
~ Christian Stewart
-
Hi HN,
protobuf-go is a widely used binary serialization library and IDL for protobuf in Go. The upstream library leverages reflection to provide a wide variety of features which are useful in a server context.
Go is increasingly being used for resource-constrained environments like embedded (tinygo) and WebAssembly. In these environments, reflection is not always available, and when it is, it adds significant weight to the binary size.
vtprotobuf: https://github.com/planetscale/vtprotobuf - compiles static code generation for Protobufs in go, including functions to marshal, unmarshal, size, clone, messages. However, it still requires protobuf-go and the reflection-based code for the message structs.
protobuf-go-lite takes this one step further with a stripped-down version of the protobuf-go code generator modified to work without reflection and merged with vtprotobuf to provide modular features with static code generation for marshal/unmarshal, size, clone, and equal. It bundles a fork of protoc-gen-go-json for JSON support.
It has already been used (experimentally) for a reflection-free version of OpenTelemetry for Go: https://github.com/gburek-fastly/opentelemetry-proto-go/pull... as well as other projects at Aperture Robotics.
Thanks & have a great Friday!
~ Christian Stewart
Related posts
-
This repository provides the protoc-gen-go-vtproto plug-in for protoc, which is used by Vitess to generate optimized marshall & unmarshal code.
-
Go Protobuf: The New Opaque API
-
Code generation for REST inter service communication?
-
How do I provide bot RPC and REST endpoints?
-
gRPC-transcoding large files