getgauge / gauge

Light weight cross-platform test automation
https://gauge.org
Apache License 2.0
2.99k stars 341 forks source link

Gauge binaries are getting bigger #310

Closed mahendrakariya closed 8 years ago

mahendrakariya commented 8 years ago

Gauge binaries are growing big. It used to be around 4-5 MB earlier.

The 64 bit binary generated for the HEAD of this repo is around 15 MB.

mahendrakariya commented 8 years ago

Here's the list of dependencies getting packaged.

$ go list -f '{{.Deps}}' github.com/getgauge/gauge | tr -s '[:space:]' '\n'

[archive/zip
bufio
bytes
compress/flate
compress/gzip
container/heap
container/list
crypto
crypto/aes
crypto/cipher
crypto/des
crypto/dsa
crypto/ecdsa
crypto/elliptic
crypto/hmac
crypto/md5
crypto/rand
crypto/rc4
crypto/rsa
crypto/sha1
crypto/sha256
crypto/sha512
crypto/subtle
crypto/tls
crypto/x509
crypto/x509/pkix
encoding
encoding/asn1
encoding/base64
encoding/binary
encoding/csv
encoding/hex
encoding/json
encoding/pem
errors
fmt
github.com/apoorvam/goterminal
github.com/daviddengcn/go-colortext
github.com/dmotylev/goproperties
github.com/getgauge/common
github.com/getgauge/gauge/api
github.com/getgauge/gauge/api/infoGatherer
github.com/getgauge/gauge/conceptExtractor
github.com/getgauge/gauge/config
github.com/getgauge/gauge/conn
github.com/getgauge/gauge/env
github.com/getgauge/gauge/execution
github.com/getgauge/gauge/execution/result
github.com/getgauge/gauge/filter
github.com/getgauge/gauge/formatter
github.com/getgauge/gauge/gauge
github.com/getgauge/gauge/gauge_messages
github.com/getgauge/gauge/logger
github.com/getgauge/gauge/manifest
github.com/getgauge/gauge/parser
github.com/getgauge/gauge/plugin
github.com/getgauge/gauge/plugin/install
github.com/getgauge/gauge/projectInit
github.com/getgauge/gauge/refactor
github.com/getgauge/gauge/reporter
github.com/getgauge/gauge/runner
github.com/getgauge/gauge/util
github.com/getgauge/gauge/validation
github.com/getgauge/gauge/version
github.com/getgauge/mflag
github.com/golang/protobuf/proto
github.com/op/go-logging
go/ast
go/parser
go/scanner
go/token
golang.org/x/net/context
golang.org/x/net/http2
golang.org/x/net/http2/hpack
golang.org/x/net/internal/timeseries
golang.org/x/net/trace
golang.org/x/tools/go/ast/astutil
golang.org/x/tools/go/exact
golang.org/x/tools/go/types
google.golang.org/grpc
google.golang.org/grpc/codes
google.golang.org/grpc/credentials
google.golang.org/grpc/grpclog
google.golang.org/grpc/metadata
google.golang.org/grpc/naming
google.golang.org/grpc/peer
google.golang.org/grpc/transport
gopkg.in/fsnotify.v1
gopkg.in/natefinch/lumberjack.v2
hash
hash/crc32
html
html/template
internal/golang.org/x/net/http2/hpack
internal/race
internal/singleflight
io
io/ioutil
log
log/syslog
math
math/big
math/rand
mime
mime/multipart
mime/quotedprintable
net
net/http
net/http/internal
net/textproto
net/url
os
os/exec
os/user
path
path/filepath
reflect
regexp
regexp/syntax
runtime
runtime/cgo
runtime/internal/atomic
runtime/internal/sys
sort
strconv
strings
sync
sync/atomic
syscall
text/tabwriter
text/template
text/template/parse
time
unicode
unicode/utf16
unicode/utf8
unsafe]
mahendrakariya commented 8 years ago

Did some more analysis. Here's the list of top 10 objects (by size) in the Gauge binary for darwin/amd64. This adds up to ~8.069 MB.

Name Size (in MB)
runtime.rodata 2.286576
type.* 2.286576
runtime.pclntab 1.934885
go.string.* 1.104472
go.func.* 0.18722
runtime.trace 0.065688
runtime.typelink 0.061888
runtime.erodata 0.061888
html.statictmp_0076 0.051312
golang.org/x/tools/go/types.(*Checker).builtin 0.028256
mahendrakariya commented 8 years ago

Tried creating an executable for darwin/amd64 for a hello world program written in Go. The binary size is 2.3 MB. Given this, I really doubt if we will be able to reduce the binary size to <5MB, what it used to be earlier. But will continue to analyze to see what can be done.

kaustavdm commented 8 years ago

Can this be due to optimizations added in Golang? Is there any change in binary size for Gauge if it is compiled with golang 1.5.x vs golang 1.6.x?

mahendrakariya commented 8 years ago

There is no significant change in the binary size between different Go versions. On Mar 17, 2016 1:19 AM, "Kaustav Das Modak" notifications@github.com wrote:

Can this be due to optimizations added in Golang? Is there any change in binary size for Gauge if it is compiled with golang 1.5.x vs golang 1.6.x?

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/getgauge/gauge/issues/310#issuecomment-197514421

sriv commented 8 years ago

Closing this. Will revisit if there is any further bloat.