Skip to content

Allow linker to perform dead code elimination #8270

@adrianmoisey

Description

@adrianmoisey

Over in kubernetes/kubernetes#132216, Dims managed to reduce the dead code in the Kubernetes binaries.

I had a look and all the libraries that prevent dead code elimination all come from upstream k/k, so we should be able to leverage these benefits in the VPA once k/k 1.34 is out.

Dims also wrote a script to ensure that this problem doesn't come back (see kubernetes/kubernetes#132290)

I gave it a test, and came up with these results:

| Binary               | Before (bytes) | After (bytes) | Reduction (bytes) | Percentage Reduction |
|----------------------|----------------|---------------|-------------------|----------------------|
| admission-controller | 73,996,402     | 43,305,218    | 30,691,184        | 41.48%               |
| recommender          | 74,984,130     | 43,873,874    | 31,110,256        | 41.49%               |
| updater              | 74,460,562     | 43,481,554    | 30,979,008        | 41.60%               |

Once k/k 1.34 is out, I'll ensure that we use these benefits and have the automation in place to not regress.

/area vertical-pod-autoscaler
/assign
/triage accepted

Metadata

Metadata

Assignees

Labels

area/vertical-pod-autoscalerkind/bugCategorizes issue or PR as related to a bug.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions