4 ms·
Yes I have found before that font loading can really slow down wine startup. I've made wine much faster to start before by deleting all references to system fon
by ubercow13 4y ago
Yes I have found before that font loading can really slow down wine startup. I've made wine much faster to start before by deleting all references to system fonts in its registry and then hiding system fonts from it while launching it.
- malkia 4y agoThat's a nice lead! - I'll try looking into that more. If you have or remember some more details - please share! Thanks! (One of my use cases is https://github.com/mstorsjo/msvc-wine https://github.com/mstorsjo/msvc-wine - and invocation of `cl.exe` or `link.exe` taking 250ms at each is not going to be great (then again `cl.exe` can be made to input several .cpp/.c files, but it becomes more awkward to express that at the build level).
- ubercow13 4y agoI am looking at the script I used to run foobar2000 in wine, it basically overwrote fontconfig envvars like export FONTCONFIG_FILE="$HOME/wine-fontconfig/fonts.conf" export FONTCONFIG_PATH="$HOME/wine-fontconfig" where fonts.conf is something like <?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> <fontconfig> <its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0"> <its:translateRule translate="no" selector="/fontconfig/*[not(self::description)]"/> </its:rules> <dir>~/wine-fontconfig/TTF</dir> <include ignore_missing="yes">~/wine-fontconfig/conf.d</include> <cachedir>~/wine-fontconfig/font-cache</cachedir> </fontconfig> and there's just one TTF font I want to use in the TTF folder. Then there are a bunch of references to systemwide fonts in the user.reg and system.reg registry files that I deleted manually, but I forget the exact keys - you can search for 'font' to find them. I also entered registry keys to redirect system fonts to the TTF I had provided, I think using [Software\\Microsoft\\Windows NT\\CurrentVersion\\FontSubstitutes] or maybe [1]. If you're running CLI tools this might not be needed. If you ever launch wine in that prefix without these environment variables, it will rescan the system fonts and populate the registry again and that seems to slow down future launches. Another thing that made a difference that I just remembered is opening winecfg 'Libraries' tab and adding an entry to set 'winemenubuilder.exe' and 'winebus.sys' to disabled. I am not sure what the consequences of the latter are but it didn't seem to break anything for my use case. There might be other inessential libraries you can disable here if they seem slow in WINE_DEBUG output, I also have winehid.sys disabled here but I can't remember if it made much difference. [1] https://wiki.winehq.org/Font_Replacements https://wiki.winehq.org/Font_Replacements
- malkia 4y agoThis is so awesome!!! Thank you!!!
- malkia 4y agoAnother lead was from godbolt's use of wine to run cl.exe (msvc) - https://github.com/compiler-explorer/compiler-explorer/blob/main/etc/firejail/wine.profile https://github.com/compiler-explorer/compiler-explorer/blob/... - I just learned about `firejail` so maybe interpreting this wrong - but it has this "private-etc passwd,fonts" which means these folders would be empty - according to this doc - https://man7.org/linux/man-pages/man1/firejail.1.html https://man7.org/linux/man-pages/man1/firejail.1.html - so possibly they had similar issues