|
|
Subscribe / Log in / New account

shared memory and loading savings

shared memory and loading savings

Posted Feb 3, 2025 20:35 UTC (Mon) by shiz (subscriber, #161017)
In reply to: shared memory and loading savings by Cyberax
Parent article: Vendoring Go packages by default in Fedora

> This is not really the case. Alpine Linux that prides itself on mostly doing static linking is snappier than regular Linuxes.

As a former Alpine maintainer: Alpine does not pride itself on doing static linking as it is dynamically linked like most other other distros.
In fact, we carry patches to enforce dynamic linking for some packages[1] that assume being musl-based means being statically linked.

> With the current state of hardware, the savings from shared text pages are generally insignificant,

Those savings can end up mattering more than you'd think, by their effect on the cache usage rather than simply the RAM footprint.
This was (back when I was active) one of the reasons we linked with -Os in Alpine, aside from fitting the goal for a small base system, for a surprising number of cases it actually lead to speedups over -O2.

>but the time to do linking adds up. This is not helped by the general design of the GNU linker, it's obsolete by 20 years. Newer linkers like `mold` help, but they still are not free.

Linking (as in the part that would be done by a program like mold) is done only once in the build process, so it shouldn't matter with regards to snappiness. The dynamic loader (/lib/ld-*.so), like the parent comment mentions, can actually benefit from things like lazy loading to improve runtime performance, however for security reasons that is disabled in most distributions (-z relro -z now) and I don't believe the musl dynamic loader supports it to begin with.

[1]: https://gitlab.alpinelinux.org/alpine/aports/-/blob/3.21-...


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds