Shared libraries
Shared libraries
Posted Nov 26, 2025 17:08 UTC (Wed) by mb (subscriber, #50428)In reply to: Shared libraries by bluca
Parent article: APT Rust requirement raises questions
>$ time for i in $(seq 10000); do /lib/cargo/bin/coreutils/true; done
Does this have a loading into memory cost of 1 or 10000?
I would be *very* surprised if this would read the binary from disk 10000 times.
Also please note that gnu-true doesn't use any shared library except for libc. Which is exactly the same in Rust.
Saying that gnu-true is faster than Rust-true due to dynamic linking is clear nonsense, because there is no difference w.r.t. dynamic linking between them.
If Rust-true is slower than gnu-true due to its bigger size, then this has nothing to do with dynamic or static linking.
Such small binaries are typically larger than their C counterpart, because the Rust std library is typically not rebuilt together with the program and therefore contains lots of unused code.
