Post #4039768
2026-07-23 11:59 UTC
Replies (1)
-
@MaddieM4@raphus.social 2026-07-23 12:05
The simplest version of this problem is the kind you can solve with tree shaking. If a library has a bunch of functionality that you don't use (because another library consumer *does* or *might* use it), the final build may be able to omit a lot of that code, by a mechanism that isn't too far off from a mark-n-sweep garbage collector, treating your application's main function as the GC root. Some amount of this low-hanging fruit usually exists, but not necessarily enough to fill your stomach with a free lunch. Are you actually writing a library that depends on a library? Now you have multiple entrypoints (public functions) that someone might use, which means more GC roots of things someone *might*, use pinning dependency content in place. You also usually end up needing to track more state that someone might use. Okay, now all your structs take longer to malloc and copy and you need to gather more information to populate them, etc. Because "might" and "maybe" are expansive words in a cautious context.