Reducing Tailscale’s binary size on macOS
Blog post from Tailscale
Mihai Parparita describes his efforts to reduce the binary size of Tailscale's macOS application, which initially appeared unusually large due to the inclusion of both x86_64 and arm64 slices, as well as the entire Go code base within the main app and its network extension. Upon discovering that the CLI interface was invoked through the main app, Parparita considered creating a separate static library for the CLI but realized this might not result in significant size savings. Instead, he explored utilizing the network extension as a shared library, allowing the app to load and invoke CLI functions dynamically using dlopen and dlsym. This approach led to a 35 MB reduction in the binary size from version 1.34 to 1.36, thereby improving download and update times.