Live data from Hacker News

Reducing Tailscale’s binary size on macOS

tailscale.com

11–20 of 34 posts

Re: Reducing Tailscale’s binary size on macOS

#11
post #6
post #2

Generally on Apple platforms the move here would be putting the shared binary into a dynamic .framework rather then trying to eliminate the shared dependency. Is this a limitation of authoring it in Go that it has to be entirely static?

As a user I’d prefer faster startup over shaving off a couple MB tbh.

Calling dlopen is perhaps one of the slowest way to bring in libraries on Darwin.

Re: Reducing Tailscale’s binary size on macOS

#12

Guys, please figure out a way to reduce your footprint on openwrt. 11452 -rwxr-xr-x 1 root root 11.2M Sep 1 2021 /usr/sbin/tailscaled 7612 -rwxr-xr-x 1 root root 7.4M Sep 1 2021 /usr/sbin/tailscale I love tailscale, but it forces me to use usb sticks on most of my openwrt routers.

There is a way to build an even smaller version of Tailscale for embedded systems, though there are some trade offs with regards to ease of use and security. https://tailscale.com/kb/1207/small-tailscale/ has more details.

Re: Reducing Tailscale’s binary size on macOS

#13

I seem to remember reading that upx had a performance impact (startup times?). @mihaip, have you been able to measure any changes before/after?

upx is not used in the macOS build (we only mention it as a possibility in https://tailscale.com/kb/1207/small-tailscale/, which is for embedded systems), so I have no done any benchmarking with it.

Re: Reducing Tailscale’s binary size on macOS

#14
post #6

Earlier quoted context omitted.

As a user I’d prefer faster startup over shaving off a couple MB tbh.

Calling dlopen is perhaps one of the slowest way to bring in libraries on Darwin.

What would you recommend? dlopen is only used when running in CLI mode (which is not super performance sensitive), but not making it slower than it needs to be would be good too.

Re: Reducing Tailscale’s binary size on macOS

#15

1.5 MB for a stub binary which does nothing but load and call a symbol from another file seems a little excessive in its own right.

Agreed. Strangely discussions of bloat sometimes trigger snarky replies:

https://news.ycombinator.com/item?id=34732782

Re: Reducing Tailscale’s binary size on macOS

#16

1.5 MB for a stub binary which does nothing but load and call a symbol from another file seems a little excessive in its own right.

The main binary also contains Tailscale’s GUI (onboarding, auth, menu, notifications, etc) so it does a little more than that.

Re: Reducing Tailscale’s binary size on macOS

#17
post #9
post #6

Earlier quoted context omitted.

As a user I’d prefer faster startup over shaving off a couple MB tbh.

Even if so that takes benchmarking on the target systems. Linking can be fast compared to reading a few extra MB from disk.

With SSDs approaching 10GB/s reads, I think that’s negligible. Also, chances are high the binary is in RAM for a long time after first use.

Re: Reducing Tailscale’s binary size on macOS

#18
Somewhat tangential, but ever since a recent update of the MacOS tailscale client, I've been unable to connect to any other exit nodes. I click on the exit node I'd like to connect to and it just silently fails. I tried making a shortcut as well that would connect to that node and it also fails. I've verified the exit node itself is working correctly on other devices, it only fails on the Macbook.

Has anyone else encountered this issue?

Re: Reducing Tailscale’s binary size on macOS

#19
post #2

Generally on Apple platforms the move here would be putting the shared binary into a dynamic .framework rather then trying to eliminate the shared dependency. Is this a limitation of authoring it in Go that it has to be entirely static?

It could also be a legacy of a lot of the team coming from Google, which statically links everything except glibc.

I'm surprised Google isn't using musl then at this point.

Re: Reducing Tailscale’s binary size on macOS

#20

Guys, please figure out a way to reduce your footprint on openwrt. 11452 -rwxr-xr-x 1 root root 11.2M Sep 1 2021 /usr/sbin/tailscaled 7612 -rwxr-xr-x 1 root root 7.4M Sep 1 2021 /usr/sbin/tailscale I love tailscale, but it forces me to use usb sticks on most of my openwrt routers.

[deleted]
Post reply on HN