News for hackers. Stuff that matters.
Re:Valve Is Paying Open-Source Developers to Work on Proton,... by jnwatson on Saturday December 17, 2022 @12:19PM (#34029839)
Shared libraries can reduce load time as they might already be in page cache. There’s also potential for a small impact in reduced instruction cache misses.

On the other side, link time optimization on static libraries allows deletion of unused functions and more aggressive inlining, so you might get that performance back and more.

Re:Valve Is Paying Open-Source Developers to Work on Proton,... by dralley on Saturday December 17, 2022 @12:36PM (#34030046)
People say this but every test case I've seen has proven otherwise. Static binaries load much faster. Maybe it depends on the size of the libraries involved an the quality of the OS' dynamic linking machinery (supposedly OSX has better runtime dynamic linking startup times than linux), but at the very least it is conditional, not a pure win.
Re:Valve Is Paying Open-Source Developers to Work on Proton,... by CamperBob2 on Saturday December 17, 2022 @05:09PM (#34032777)
Not only that, but executable images are demand-paged anyway. You can link 1 GB of static library code if you like; you won't pay the penalty unless and until those functions are actually called.

The whole debate is just stupid. If it inconveniences even one fewer user, then static linking is the way to go, because of the sheer number of drawbacks that shared libraries bring. Nobody cares how big the executable is. If you do, well... the best time to stop caring was 10 years ago, and the second best time is now.

Re:Valve Is Paying Open-Source Developers to Work on Proton,... by bombolo on Saturday December 17, 2022 @05:23PM (#34032918)
But the called functions need to be loaded in memory for every process using them, instead of once.

Also there is value in being able to fix a library without having to recompile everything.

Re:Valve Is Paying Open-Source Developers to Work on Proton,... by craftkiller on Saturday December 17, 2022 @06:10PM (#34033256)
Everything is getting recompiled all the time anyway. At least with FreeBSD, any time a dependency is updated, all the packages that depend on that package get rebuilt. There's no concept of "this was a small update and its dynamically linked", its just "the version string changed, so rebuild everything that lists it as a dependency". This is particularly "fun" for web browsers because they have a lot of dependencies, ensuring they're rebuilt often, and they take a long time to build.
Re:Valve Is Paying Open-Source Developers to Work on Proton,... by bombolo on Saturday December 17, 2022 @06:39PM (#34033429)
> Everything is getting recompiled all the time anyway.

Source? I know when stuff on my distribution gets recompiled because then I have to download and unpack it, so I notice.

I can assure you that it isn't as you say.

> with FreeBSD

Despite the monorepo thing, I assure you that most FreeBSD users do use software coming from other places as well.

Re:Valve Is Paying Open-Source Developers to Work on Proton,... by CamperBob2 on Saturday December 17, 2022 @06:46PM (#34033474)
If nothing else, you probably see several megabytes' worth of JIT compilation whenever you visit a JavaScript-heavy web page. Same effect... namely, none at all.
Re:Valve Is Paying Open-Source Developers to Work on Proton,... by bombolo on Sunday December 18, 2022 @02:25AM (#34035701)
Lol sure… JIT only does the hot paths, not the whole thing. It certainly will not make several mb of output without my computer sounding like an ariane5 launch
Re:Valve Is Paying Open-Source Developers to Work on Proton,... by CamperBob2 on Saturday December 17, 2022 @06:48PM (#34033494)
Also there is value in being able to fix a library without having to recompile everything.

Number of times I have benefited from this process: 0 (AFAIK)

Number of times this process has hosed previously-working applications and components: too many to count

On Windows, this "feature" was called "DLL Hell," and was generally considered a bad thing. Nothing has fundamentally changed since it was a common practice for every installer to have its way with c:\windows, IMHO. (Admittedly shared MSVC runtimes aren't as big a problem as the Winsock-provider-du-jour was, but still... there is simply no point.)

Re:Valve Is Paying Open-Source Developers to Work on Proton,... by bombolo on Sunday December 18, 2022 @02:26AM (#34035702)
> Number of times I have benefited from this process: 0 (AFAIK)

Every day on my distribution, when I have to download 5kb of library instead of 3GB of everything recompiled…