Solia saysLibrary functions can be embedded (internal, inlined at every call site) or linked (external, deployed once and delegatecalled) — picking the wrong one wastes bytecode or gas.
Solidity libraries come in two flavors. Embedded libraries have only internal functions; the compiler inlines their code at every call site. Linked libraries have at least one external/public function; they are deployed once and called via delegatecall from every consumer.
Embedded is cheap to call (no delegatecall overhead) but bloats every consumer with the library bytes. Linked saves bytes per consumer but pays ~700 gas per call for the delegatecall. using LibX for Type makes calls look like methods on a type. The demo compares the trade-offs for 5 call sites.
Power-ups you unlock
Embedded: internal functions inlined at every call site