Wine slow on launch
Wine on launch
Wine isn’t just running your .exe, it initializes a Windows environment first:
- Scans fonts (~/.fonts) to build a font registry
- Enumerates network devices (CUPS printers)
- Connects to audio (PipeWire/PulseAudio)
- Sets up other system integrations
Any of these can block startup if something is slow or unreachable.
Finding the culprit with strace
strace --follow-forks --syscall-times --absolute-timestamps=time,us wine cmd /c echo hi 2>&1 | less
Or log it to a file
strace --follow-forks --syscall-times --absolute-timestamps=time,us wine cmd /c echo hi > wine_load_trace.log 2>&1
What to look for:
- Threads blocked for seconds
- Thousands of newfstatat/openat calls against the same paths
- Timeouts on network sockets (printers, samba shares)
Example case for fonts
Thread blocked in ioctl(NTSYNC_IOC_WAIT_ANY) for 6+ seconds waiting on a
sibling process making ~86,000 syscalls, almost all newfstatat/openat
against a handful of .woff2 files, each opened ~130 times.
I had a lot of fonts in my ~/.fonts but they aren’t all necessary, with
duplicate fonts, .woff, .woff2.
Check the fonts directory:
du -sh ~/.fonts; find ~/.fonts -type f | wc -l
After removing duplicate files and unneeded woff/woff2 files we went from 578MB/1373 files to 240MB/458 files.
This changed the cold startup from 22–101s to ~1.5s and warm from 8.7s to ~0.19s.