Skip to content

Optimize Go binary sizes via DCE-elimination-elimination #56636

@howardjohn

Description

@howardjohn

kubernetes/kubernetes#132216

Various libraries kill Go's ability to do dead code elimination.

Follpwing these techniques I got pilot-agent from 25.7mb to 20.9mb! This required disabling text/template, -tags=grpcnotrace, and removing an import on github.com/grpc-ecosystem/go-grpc-middleware/retry which imports the net/trace.

  • grpcnotrace is just valid
  • grpc-go-middleware can probably get a patch upstream to respect grpcnotrace
  • Replacing text/template is more problematic since we use it for the bootstrap. need to find a solution for that!

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/automatically-closedIndicates a PR or issue that has been closed automatically.lifecycle/staleIndicates a PR or issue hasn't been manipulated by an Istio team member for a while

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions