Live data from Hacker News

Reducing Tailscale’s binary size on macOS

tailscale.com

21–30 of 34 posts

Re: Reducing Tailscale’s binary size on macOS

#21
post #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 enc…

[deleted]

Re: Reducing Tailscale’s binary size on macOS

#23
post #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.

Plus, it's a universal binary with x86_64 and arm64 slices.

Re: Reducing Tailscale’s binary size on macOS

#24
post #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.

Oh, if that's the case then 1.5 MB seems much more reasonable. Never mind.

Re: Reducing Tailscale’s binary size on macOS

#25
post #19

Earlier quoted context omitted.

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.

They were spearheading the LLVM libc project at one point, I'd assume they'd replace glibc with that if anything.

Re: Reducing Tailscale’s binary size on macOS

#26

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.

That's pretty normal for statically linked executables unless you're aggressively stripping and removing things (which is hard to do)

Re: Reducing Tailscale’s binary size on macOS

#27

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

bloated is relative and subjective but the only context where an 11MB binary could be considered bloated is embedded

hard to take seriously the idea that 11MB is bloated in a normal linux server or user desktop environment

Re: Reducing Tailscale’s binary size on macOS

#28
post #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 enc…

Can you sent a message to support@tailscale.com about this and include a bug report ID (option click on the Tailscale menu icon and choose Debug -> Bug Report…)?

Re: Reducing Tailscale’s binary size on macOS

#29
post #14

Earlier quoted context omitted.

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.

You should link against the library directly. dyld’s optimizations are complex, especially when it comes to third party code, but by linking directly the system can cache some of the work.

Re: Reducing Tailscale’s binary size on macOS

#30

Earlier quoted context omitted.

Agreed. Strangely discussions of bloat sometimes trigger snarky replies: https://news.ycombinator.com/item?id=34732782

bloated is relative and subjective but the only context where an 11MB binary could be considered bloated is embedded hard to take seriously the idea that 11MB is bloated in a normal linux server or user desktop environment

If the program in intended by me to run on a small form factor computer with limited storage, such as a router, then the program nearly doubling in size is going to draw attention.
Post reply on HN