Hacker News new | ask | show | jobs
by sshine 9 days ago
I did a similar attempt to produce small AppImages for GTK applications where static binaries are not an option. With a bit of recompiling dependencies with different flags and trimming i18n away, I went from 897MB to ~20MB.

https://simonshine.dk/articles/nix-appimage-when-musl-is-not...

1 comments

I initially tried GTK but found it added a lot of overhead. In my experiment, I used Wayland directly and draw the pixels using the CPU. Another trick was to render fonts directly. Using these approaches, the binary is under 300MiB and the initial PSS is < 1MiB.

I was thinking of maybe turning it into a minimal UI framework. I noticed that Quickshell apps in Hyprland are comparatively very large so something lighter weight might be useful.

I did exactly compare GTK with direct drawing and found that direct drawing is only faster when you don’t need typical UI components.

When you only want to update the part of the screen that changes, you quickly start to build a library, and GTK is such a library.