-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
protos: compile out unnecessary protos #178
Comments
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions. |
@junr03 do you have any scripts or tooling for this kind of analysis that we could add to Envoy CI? I'm interested in driving some automation around Envoy's dependencies, and we've added binary size to the policy in https://docs.google.com/document/d/1HbREo7pv7rgeIIjQn6mNpySzQE5rx2Yv9dXm5NqR2N8/edit#heading=h.xnpvc6pk0h0v. It would be helpful to be able to quickly spot the binary size contribution from different libraries, and I'm guessing you might have already done some of this work. |
Answering my own question, I think https://envoy-mobile.github.io/docs/envoy-mobile/latest/development/performance/binary_size.html captures this and we want to use Bloaty.. |
@htuch yep, that's the process I follow. Using different bloaty configs with different path regexes affords you a lot of ways to dice the binary. Awesome! Glad to see size making it in there. Lmk if I can be of help. |
Also proto folks call out --copt='-DPROTOBUF_EXPERIMENTAL_USE_TAIL_CALL_TABLE_PARSER=1 as a new flag for improving size of files we could look into using |
also proto lite if we can avoid reflection for mobile |
A high cost option in this space is to migrate to something based on https://github.com/protocolbuffers/upb Protobuffer team is working on various aspects of this as part of long term strategies. It is important to note, however, that upb is an explicitly unstable api. It is intended to be an internal toolkit for building protobuf implementations. |
gRPC already does some of this https://github.com/grpc/grpc/tree/master/third_party/upb |
I noticed from object file analysis that compiled protos make up the biggest percentage of binary size:
More importantly, there are a lot of protos that are not needed in Envoy Mobile:
However, upstream Envoy compiles all of these in, mostly because they are all needed in the server's bootstrap code. Given the size, it is worth it to investigate ways to compile out unnecessary protos. Or better yet, link in protos on-demand.
Size Win
This entirely depends on what protos we end up needing to link in, but the ceiling is ~2mb.
The text was updated successfully, but these errors were encountered: