Earlier quoted context omitted.
> The case for the shared library having better caching implies multiple processes that are distinct executables But this is the most common case for desktops/multipurpose systems. On my desktop there are tens or hundreds distinct processes sharing most of their code.
No it is not. Depending on your CPU, you might have, say, 32KB of 8-way associative instruction cache per core. Just being shared does not make it fit in the cache. A shared library would only be there across processes of different executable images if its users primarily , continuously execute the same paths in shared libs rather than anything unique in their own executable image - e.g., they'd more or less need to…
Yes, like libc/WinApi, Cairo/whatever graphics library of your OS, Gtk/Qt etc
All of the apps on my desktop (I don't use electron) share vast majority of their code (see above) and spend most of their time drawing UI through shared libs or doing their own business logic but that's part of their code and not subject to shared lib overhead.