Friday, December 6, 2024
HomeGolangMethods to cut back software exe dimension - Getting Assist

Methods to cut back software exe dimension – Getting Assist


Methods to cut back software exe dimension.

Might I make my exe in small dimension by introducing idea like runtime loading code in golang

I feel you possibly can take away debug data from an software when constructing with -ldflags, if you wish to do that :grinning:
for instance:

-ldflags: Linker flags can be utilized to strip debug data and unused code.
go construct -ldflags "-s -w" -o yourapp
-s: Omit the image desk and debug data.
-w: Omit the DWARF image desk.

shortcoming is clearly, that you’ll lose all of your debug data
if a crash happens, you cannot discover the issue



1 Like

strive uing upx, https://upx.github.io/

You possibly can all the time use Tinygo if binary dimension is a priority.

TinyGo is neat, nonetheless there’s a minimal likelihood your venture would truly work with it as a result of there may be a variety of issues unimplemented, like large a part of the usual library.

It appears to be like such as you’re already utilizing UPX to compress your executable. For additional discount, you would possibly contemplate combining it with linker flags like -ldflags “-s -w” to strip debug data. Moreover, evaluating TinyGo might be price it in case your venture is appropriate, although be aware of its limitations.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments