Open YaoZengzeng opened 1 week ago
https://github.com/loov/goda And many other similar tools are there
/assign
Hey @hzxuzhonghu
I’ve used goda to generate the dependency graph, but I haven’t been able to identify any unnecessary dependencies. It’s possible that I’m not analyzing it correctly. I need your help
After adding -s -w to the ldflags, the sizes of the binaries are as follows:
ls -lh kmeshctl
-rwxr-xr-x 1 root root 72M Oct 15 16:49 kmeshctl
ls -lh out/kmesh-daemon
-r-xr--r-- 1 root root 87M Oct 15 16:43 out/kmesh-daemon
Do you think these sizes are sufficient? Should we consider adding DEBUG flags like all=-N -l, similar to what Kubernetes and Istio do?
kubernetes
if [[ "${DBG:-}" == 1 ]]; then
# Debugging - disable optimizations and inlining and trimPath
gogcflags="${gogcflags} all=-N -l"
else
# Not debugging - disable symbols and DWARF, trim embedded paths
goldflags="${goldflags} -s -w"
goflags+=("-trimpath")
fi
istio
ifeq ($(origin DEBUG), undefined)
BUILDTYPE_DIR:=release
else ifeq ($(DEBUG),0)
BUILDTYPE_DIR:=release
else
BUILDTYPE_DIR:=debug
export GCFLAGS:=all=-N -l
$(info $(H) Build with debugger information)
endif
The graph is based on kmesh-daemon?
I agree with the suggestion by building with release flag
This is generated with goda tree, ptal, istio.io/istio/pkg/kube
seems contains a lot of unneccessary packages. May try to not use it
We can construct port-forwarder from k8s.io/kubectl/pkg/cmd/portforward
The graph is based on kmesh-daemon?
I agree with the suggestion by building with release flag
I apologize for my misunderstanding of how to use Goda. The graph was actually generated by the command goda graph "./..." | dot -Tsvg -o graph.svg
. I realize that this is incorrect, and I appreciate you pointing that out.
We can construct port-forwarder from k8s.io/kubectl/pkg/cmd/portforward
Thank you for your advice! I really appreciate it, and I will try to write it down.
Task description:
The binary size of
kmeshctl
as follows:In contrast, the binary size of
istioctl
is:size of
kubectl
is:size of
kmesh-daemon
:Solution:
Maybe optimize go compilation options or remove unnecessary dependencies?
Who can join or take the task:
The good first issue is intended for
first-time contributors
to get started on his/her contributor journey.After a contributor has successfully completed 1-2 good first issue's, they should be ready to move on to
help wanted
items, saving the remaininggood first issue
for other new contributors.How to join or take the task:
Just reply on the issue with the message
/assign
in a separate line.Then, the issue will be assigned to you.
How to ask for help:
If you need help or have questions, please feel free to ask on this issue. The issue author or other members of the community will guide you through the contribution process.