4 ms·
Agree. As an example, this proto generates 584 lines of C++, links to 173k lines of dependencies, and generates a 21Kb object file, even before adding grpc: sy
by morganherlocker 2y ago
Agree. As an example, this proto generates 584 lines of C++, links to 173k lines of dependencies, and generates a 21Kb object file, even before adding grpc:
syntax = "proto3";
message LonLat {
float lon = 1;
float lat = 2;
}
Looking through the generated headers, they are full of autogenerated slop with loads of dependencies, all to read a struct with 2 primitive fields. For a real monorepo, this adds up quickly.
- cyberax 2y agoThis is because protobuf supports full run-time reflection and compact serialization (protobuf binary objects are not self-describing), and this requires a bit of infrastructure. This is a large chunk of code, but it is a one-time tax. The incremental size from this particular message is insignficant.