Closed
Description
What happened?
Commit b31e779 by @p0lyn0mial uses cmp.Diff()
which depends on reflect.Type.Method(n int)
. Upon encountering the use of this method, the go compiler disables the dead code elimination.
The commit message for b31e779 indicates that
The consistency check is meant to be enforced only in the CI, not in production.
Please fix the consistency check to disable the DCE only in CI, not in the production.
What did you expect to happen?
Debug code must not pessimise the code generation for prod environments.
How can we reproduce it (as minimally and precisely as possible)?
You can use go build -ldflags '-dumpdep'
to have the compiler dump the dependency graph of linked symbols. Any symbol marked with <ReflectMethod>
disables the DCE.
Anything else we need to know?
No response
Kubernetes version
Cloud provider
any
OS version
No response
Install tools
No response
Container runtime (CRI) and version (if applicable)
No response
Related plugins (CNI, CSI, ...) and versions (if applicable)
No response