If end binary size is a constraint, try "upx" to compress the end binary. I 
regularly get 3x compression - but lose all debug options, obviously. Works 
on most OSes for executables.

On Friday 14 June 2024 at 22:43:53 UTC+1 Tony M wrote:

> Thank you to github.com/jondot/goweight I was able to determine the 
> compiled module sizes (below). Heavy hitters are net/http & protobufs, 
> among 100+ others .  Total compile size is 22MB . 
>
> Are there any tools or flags that can help strip or reduce some of the 
> compiled code from these modules? 
>
>  goweight gcloud-lite
>    11 MB runtime
>   7.7 MB net/http
>   5.3 MB google.golang.org/protobuf/internal/impl
>   5.2 MB google.golang.org/api/storage/v1
>   4.5 MB cloud.google.com/go/storage
>   4.2 MB golang.org/x/net/http2
>   4.0 MB golang.org/x/sys/unix
>   3.8 MB net
>   3.8 MB cloud.google.com/go/storage/internal/apiv2/storagepb
>   3.6 MB crypto/tls
>   3.4 MB google.golang.org/grpc
>   3.4 MB cloud.google.com/go/pubsub/apiv1/pubsubpb
>   3.2 MB cloud.google.com/go/pubsub/apiv1
>   2.6 MB reflect
>   2.4 MB google.golang.org/grpc/internal/transport
>   2.3 MB google.golang.org/protobuf/internal/filedesc
>   2.1 MB cloud.google.com/go/pubsub
>   1.9 MB google.golang.org/protobuf/types/descriptorpb
>   1.9 MB math/big
>   1.9 MB encoding/gob
>   1.8 MB go.opencensus.io/plugin/ochttp
>   1.7 MB syscall
>   1.7 MB cloud.google.com/go/storage/internal/apiv2
> [50+ more]
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/a0ca8a4a-7953-4e0e-8544-e7cb9c5cc5cdn%40googlegroups.com.

Reply via email to