3 ms·
> ...a relic of the past when memory and disk space were expensive ... a few megs here and there might actually matter... The nature of the modern computer is
by groks 11y ago
> ...a relic of the past when memory and disk space were expensive ... a few megs here and there might actually matter...
The nature of the modern computer is that cpu speed has increased more than memory speed, so if your data doesn't fit into cache your cpu will be do nothing quickly.
Even with shared libraries, this phenomena has such an impact that the Linux kernel now has a memory de-duplication feature (mostly for VMs):
https://lwn.net/Articles/306704/ https://lwn.net/Articles/306704/
- 4ad 11y agoThis has NOTHING to do with shared libraries vs. statically-linked code. The size of the binary is completely irrelevant when considering if the code fits in the CPU cache. What's important is the size of code that actually executes. Dynamic linking changes nothing.
- twoodfin 11y agoI'm not sure what you mean. Absent some deduplication wizardry by the OS, if I have 60 processes using the "same" statically linked copy of libfoo, that's 60 copies of libfoo's instructions and static data fighting for cache and real memory. Dynamic linking & decades-old virtual memory technology cull that to a single copy.