5 ms·
On my mac the go version of yes creates a binary that's 30x larger than the yes binary I have on a linux machine. 2MB vs ~65KB.
by staplung 3y ago
On my mac the go version of yes creates a binary that's 30x larger than the yes binary I have on a linux machine. 2MB vs ~65KB.
- svnpenn 3y agoon mine it is 1,354 KB. I prefer the 10x LOC savings over a megabyte of hard drive, but you do you.
- BenjiWiebe 3y agoBut if everything was written in Go it might be 1 megabyte * the number of users of coreutils. Might be worth using a few more lines of code to save a little bit of space on a lot of machines.
- commonlisp94 3y agoIt's not about hard drive space, it's about start up time. The 10x LOC (despite being a huge exaggeration) is also the fixed cost, not the marginal cost. You're only forging main loop and includes, not any fundamental complexity. This is also a funny argument coming from a Go programmer considering that Go trades off conciseness and expressivity for simplicity. Show me some of your favorite Go and I'm sure we can replace it with some concise C++.
- 38 3y ago> C++ I just physically shuddered
- commonlisp94 3y agoI bet you did.
- smashed 3y agoThis. In fact, most embedded Linux thingy will be running the busybox version of core utilities instead of gnu coreutils for binary size reasons. I other words, even gnu coreutils is too big.
- IshKebab 3y agoRight but that's mostly because it includes its runtime and the C version does not. It's pretty easy to avoid this problem anyway - just combine multiple tools into one binary like Busybox does. In any case the simplicity of the Go code is not really related to the binary size.