Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Generally the Go runtime (garbage collector, scheduler, allocator, etc) alone is 2-5MB, for additional context.


a bit less:

    $ cat > t.go
    package main
    func main() {}
    $ go build t.go
    $ ls -l t
    -rwxr-xr-x  1 f2f  staff  1101432 24 Jul 23:19 t


And you can drop that down to ~775k by using `strip`.

    [rjp@hostname tmp]$ ls -l gosize 
    -rwxr-xr-x 1 rjp rjp 1126905 Jul 25 07:00 gosize 
    [rjp@hostname tmp]$ strip gosize
    [rjp@hostname tmp]$ ls -l gosize 
    -rwxr-xr-x 1 rjp rjp 793704 Jul 25 07:00 gosize
    [rjp@hostname tmp]$ go version
    go version go1.12.7 linux/amd64


Not sure, but is it possible that the runtime (or parts thereof) isn’t linked in in that example?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: