How to reduce compiled file size?

前端 未结 12 753
野性不改
野性不改 2020-11-28 20:59

Lets compare c and go: Hello_world.c :

#include
int main(){
    printf(\"Hello world!\");
}

Hello_world.go:

         


        
12条回答
  •  无人及你
    2020-11-28 21:30

    You may take a look at my small research on this subject: https://github.com/xaionaro/documentation/blob/master/golang/reduce-binary-size.md

    It shows step-by-step how to reduce a 2MiB hello-world static-binary sample to 15KiB static-binary or to 10KiB dynamic-binary. Of course there's a lot of limitations.

提交回复
热议问题