by fefe23 · 6y ago · 0 comments
For comparison: ripgrep (Rust) is >2 MB stripped, GNU grep is <200k stripped.
I have not looked at systemd in a while, but I'd be surprised it systemd in total is not smaller than the Rust runtime, which would leave your minimal subset larger than the original.
So maybe you meant something other than code size here, but using words like "minimal" and "subset" feel a bit (unintentionally, probably) misleading to me.
I'm sure the Rust people will at some point find a way to reduce the footprint of the runtime. Currently they have other, more pressing goals.
Personally, I wrote my own init system. The PID 1 process is a 10k statically linked binary. Resident memory size is 24k on one of my AMD64 Linux production servers. That is what I think could rightfully be called a minimal subset.
> I have not looked at systemd in a while, but I'd be surprised it systemd in total is not smaller than the Rust runtime, which would leave your minimal subset larger than the original.
Isn't this simply a result of the C runtime not being bundled with the executable? How does the comparison look when accounting for that difference?
It also depends on the how the code is structured, musl for example is structured not to pull in unneeded objects while the size of the glibc docker container speaks for itself.
That said you can beat C's code size with hand assembly and p-code interpreters.
I understood it as as a subset of features. It doesn't seem to me that the author is trying to play code golf with their codebase, or optimize for binary size (and why would you in 2019, storage is cheap)