-
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
size: optimizations for dynamic library #2049
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Reflejo
changed the title
size: Reduce size of dynamic library
size: optimizations for dynamic library
Feb 10, 2022
buildbreaker
previously approved these changes
Feb 10, 2022
optional, but I think this one is worth a release note! |
buildbreaker
previously approved these changes
Feb 10, 2022
Size delta: -0.66 Mi Signed-off-by: Martin Conte Mac Donell <reflejo@gmail.com>
The .dynstr section of the binary as well as the symbol table is pretty big for a shared library with almost no (intended to be) exported symbols. This change makes all symbols hidden by default. We should test and add to visible if some are missing. Size delta: -5.66Mi Signed-off-by: Martin Conte Mac Donell <reflejo@gmail.com>
This change updates pgv to a version that supports a "cc nop" language. With that we can make the validation functions a NOP that hopefuly gets inlined. This is the PGV change for reference: bufbuild/protoc-gen-validate#533 Size delta: -3.7 Mi Signed-off-by: Martin Conte Mac Donell <reflejo@gmail.com>
jpsim
reviewed
Feb 18, 2022
@@ -1,5 +1,16 @@ | |||
workspace(name = "envoy_mobile") | |||
|
|||
# TODO[fz]: Remove once envoy updates PGV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifically, any release including this PR: bufbuild/protoc-gen-validate#533
jpsim
approved these changes
Feb 18, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These are the different low hanging fruit fixes to reduce the dynamic library size. Note wins were calculated in isolation against a fixed target for just one architecture so they are not necesarily additive.
remove api v2 dependency (Mostly done here: api: remove v2 dependencies from v3 API protos. envoy#18817)
compile optimizing for size
set default visibility to hidden
override pgv validations with NOP functions
For the measured case (a few months back) the size reduction accounted for about -46.2%
This PR is better reviewed commit by commit.