83
this post was submitted on 15 Sep 2025
83 points (97.7% liked)
Linux
9868 readers
389 users here now
A community for everything relating to the GNU/Linux operating system (except the memes!)
Also, check out:
Original icon base courtesy of lewing@isc.tamu.edu and The GIMP
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I have no idea how. I write better Rust than I do C π€·ββοΈ
Rust and C are basically identical in terms of performance (more or less). Idk where the myth that Rust is somehow less performant than C came from.
It depends on what you are counting as "performance"
Good C code is way better than mediocre Rust code. C also has much smaller binaries.
If your goal is small binaries, it's possible to get them with Rust, too: https://github.com/johnthagen/min-sized-rust
There are a variety of reasons why Rust binaries tend to be bigger unless you follow some of those guidelines, but the biggest one (and actually not something those guidelines recommend changing!) is that C is generally dynamically linked against a system version of the C standard library, whereas Rust binaries are statically linked by default, meaning that the binary is actually self-contained.
rust still produces larger binaries even if you compare it to static C binaries.
Take for example busybox, you can compile all of it as a single 1.2 MiB static binary that provides 395 utilities including wget.
Meanwhile the uutils static musl binary is 12 MiB and only provides 115 utilities.
That's not a fair comparison at all. Busybox is specifically optimized for size, and to accomplish that, leaves out a large number of GNU compatibility features; uutils is designed to mimic GNU as closely as possible, and I'm assuming that the binary you're looking at is not the "small-release" build. Just to see what that looks like, I've built it that way now and that puts it under 7 MiB; still much larger than busybox, but it shows how much the optimization choices matter.
Such as? busybox provides a nice interactive shell,
awk,bc,wgetand much more. I know GNU awk has a lot more features than posix awk but awk is not part of the uutils anyways.busybox also implements
[[from bash, none of this is provided by uutils or coreutils.EDIT: busybox also provides grep while the uutils/coreutils don't.
I'm assuming this uses
-Oswhich means performance hit, (iirc busybox also uses -Os so it is fair comparison), still we are looking at 7x larger binary.From the busybox "about" page:
Neither of these is true for uutils, which is specifically targeting perfect GNU compatibility. I don't think there is a comparable Rust project for minimized utilities.
Note: GNU cousins, not GNU coreutils.
GNU awk, GNU grep, bash, wget, etc will give you a lot more features than the busybox equivalents. However the uutils nor coreutils implement those features at all.
If anything the comparison is not being fair to busybox because busybox implements a lot more utilities.
Busybox
lshas 26 flags. GNUlshas 60.fair, in that case the comparison is even since busybox provides a shell, awk, grep, wget among other 395 utils, uutils it is 115.
I really don't think these are clearly comparable. I would rather see two more similar projects with comparable functionality that are both attempting to optimize for program binary size.
Well if you still insist. Just went to check how big is the GNU coreutils as a single static binary, it is 2.3 MiB in size
check it out: https://pkgs.pkgforge.dev/repo/bincache/x86_64-linux/coreutils/nixpkgs/coreutils/