Skip to content
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

size: strip envoy api's v2 protos #710

Closed
junr03 opened this issue Feb 28, 2020 · 5 comments
Closed

size: strip envoy api's v2 protos #710

junr03 opened this issue Feb 28, 2020 · 5 comments

Comments

@junr03
Copy link
Member

junr03 commented Feb 28, 2020

According to my most recent binary size test the compiled v2 protos accounted for ~10% of the compiled binary (v3 equivalently accounting for another 10%).

Given that Envoy Mobile has migrated to using only v3 config we should investigate creating an option in envoy to only compile in the protos for the currently in use api version. Although here we are talking about v2 and v3 specifically, this solution should apply to subsequent version changes.

@htuch and @lizan will have good ideas about how to go about doing this in agreement with Envoy's vision for api usage, so we should connect with them.

My rough idea for getting started is:

  1. Right now all the api_proto_package targets for v3 contain their v2 counter parts. For instance, here. There should be a bazel option to not include that dependency. This would get us started in not including the v2 protos at compile time.
  2. For runtime we need to look a bit more if dropping the protos is safe.
    • Last I checked, call sites of this getEarlierVersionDescriptor check for null, so we should be able to not have the v2 protos safely.
    • We need to see how xDS subscriptions decide which version to use with upstream servers, and make sure the correct setting gets applied to only speak one version of the api, and for that version to be the same as the currently "in use" api.
@junr03
Copy link
Member Author

junr03 commented Feb 28, 2020

These are all my current thoughts on this space. Nothing too fleshed out, but enough to get started. @buildbreaker I am assigning to you, as discussed internally, while I am out.

@stale
Copy link

stale bot commented Apr 17, 2020

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.

@stale stale bot added the stale label Apr 17, 2020
@stale stale bot removed the stale label Apr 17, 2020
@junr03
Copy link
Member Author

junr03 commented Oct 28, 2020

After running a fresh analysis 10/2020 this issue continues to be the greatest investment we can make. Compiled protos account ~34% of the binary size so dropping v2 protos should see a >15% reduction.

@htuch
Copy link
Member

htuch commented Nov 9, 2020

@junr03 given the plan to remove v2 in Q1 next year, do you think it makes sense to add this support to minify now or wait?

@Reflejo
Copy link
Contributor

Reflejo commented Oct 28, 2021

Envoy (and envoy-mobile) doesn't (or won't) include v2 anymore since envoyproxy/envoy#18817

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants