http://bugs.winehq.org/show_bug.cgi?id=59695 Bug ID: 59695 Summary: load_init_registry_from_file takes a long time during wine boot Product: Wine Version: 11.7 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: registry Assignee: wine-bugs@list.winehq.org Reporter: stephan.seitz@fau.de Distribution: --- Created attachment 80812 --> http://bugs.winehq.org/attachment.cgi?id=80812 Flamegraph showing time spend during wine boot Please excuse if this is a duplicated. I noticed that wine boot takes a long time on my machine. Being curious I ran perf (see flamegraph screenshot) on it and saw that most of the time (almost 16s) is spent during load_init_registry_from_file. I was wondering whether there is a faster way to deserialize the registry. I built wine from source 607d214b9b33be8ee7377f194a98c01a36af803c (2026/04/05) using `./configure && make -j20`. I have a wine prefix with some development tools installed. 28% of the overall boot time samples is spend in running the two `to_lower` in `memicmp_strW` server/unicode.c ``` static inline WCHAR to_lower( WCHAR ch ) { return ch + casemap[casemap[casemap[ch >> 8] + ((ch >> 4) & 0x0f)] + (ch & 0x0f)]; } int memicmp_strW( const WCHAR *str1, const WCHAR *str2, data_size_t len ) { int ret = 0; for (len /= sizeof(WCHAR); len; str1++, str2++, len--) if ((ret = to_lower(*str1) - to_lower(*str2))) break; return ret; } ``` so optimizing `memicmp_strW` would have a big impact on boot time (e.g. adding a fast path for ascii chars or adding vectorization if that is possible in the wine server and we are allowed to access memory past a possible \0 byte. If the registry would be stored as a case-insensitive filesystem or consistent with the in-memory representation of the registry it would maybe even be possible to skip deserialization or make it very cheap. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.