Re:Building static binaries with Go on Linux
by eliben on Tuesday July 30, 2024 @10:44PM
(#41116010)
I wonder if it's Zig or musl that's to blame; did you end up statically linking with musl using musl-gcc, or did you forego static linking entirely?
Re:Building static binaries with Go on Linux
by jcelerier on Wednesday July 31, 2024 @08:10AM
(#41118502)
It's well-known that musl is in general much, much slower than glibc. People keep rediscovering that for some reason, likely because they hear of stuff like old echoes of Usenet posts ranting against glob "bloat", not being aware that a lot of what people call bloat is specialization of a lot of performance-sensitive algorithms to leverage SIMD, special-casing, math optimisations, etc.
When you check the glibc mailing lists, it's obvious performance is a predominant concern.
Re:Building static binaries with Go on Linux
by JackYoustra on Tuesday July 30, 2024 @11:51PM
(#41116272)
I've heard you can just swap out allocators pretty easily - did something prevent this? Or perhaps its not as straightforward as I've thought...
I’ve experienced the same performance issues with cgo + a library compiled with zig cc. IIRC it seemed like an issue with the zig tooling not plumbing the optimization flags through the ancient autotools build system for our required dependency. After a while fiddling, we just rolled it back too.
I haven’t tried this in about a year, so maybe the tooling doesn’t have these issues now.
Re:Building static binaries with Go on Linux
by dylanh on Wednesday July 31, 2024 @12:31AM
(#41116417)
This sounds like the musl allocator.
Using mimalloc or jemalloc would probably fair a lot better.
Re:Building static binaries with Go on Linux
by tarruda on Wednesday July 31, 2024 @03:34AM
(#41117101)
Is this a problem in distributions that use musl as the system libc (Alpine) ?
Re:Building static binaries with Go on Linux
by azathothas on Saturday August 10, 2024 @07:01AM
(#41208662)
Interesting...
I have been building & using a statically compiled tailscale (with CGO) for a while but didn't notice any performance hits. Script: https://github.com/Azathothas/Toolpacks/blob/main/.github/sc...
(Needless to say, we have better load testing tooling now)
I forget the details, but something about the libc allocator used by SQLite-with-Zig-libc being ... not good.