http://bugs.winehq.org/show_bug.cgi?id=60295 Bug ID: 60295 Summary: shell32: SHELL32_GetCustomFolderAttributeFromPath performs uncached desktop.ini CreateFile lookup at every ancestor directory on each shell attribute query, causing severe slowdown with large directory listings Product: Wine Version: 11.0 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: critical Priority: P2 Component: shell32 Assignee: wine-bugs@list.winehq.org Reporter: kellnerp@earthlink.net Target Milestone: --- Distribution: --- Created attachment 82041 --> http://bugs.winehq.org/attachment.cgi?id=82041 Discussion of backtrace ShellItem_GetAttributes() in dlls/shell32/shellitem.c walks the full path from the shell namespace root to the target item via repeated SHELL32_BindToChild() calls (one per path component). At every level of this walk, SHELL32_GetCustomFolderAttributeFromPath() (dlls/shell32/shlfolder.c:75) performs a blocking GetPrivateProfileStringW() call against that directory's desktop.ini, which in turn does a full CreateFileW/NtCreateFile syscall via PROFILE_Open() (dlls/kernel32/profile.c:764). This lookup is not cached per-directory. Every call to ShellItem_GetAttributes() for an item N levels deep triggers N blocking file-open attempts, regardless of whether the directory has already been queried in this same operation. For workloads that call shell attribute queries once per file across a large, deeply-nested directory (e.g., an application enumerating thousands of files in a single folder and querying SFGAO_* attributes per item — this is what triggered the report, via Insta360 Studio, a Qt5-based app, importing a folder of several thousand sequentially-named interval/timelapse photos), this becomes O(files × path_depth) blocking file-open syscalls, each requiring a full wineserver round-trip. With a large enough file count this manifests as the application appearing to hang or freeze for an extended period, even though it is not deadlocked — it is making very slow forward progress. Reproduction Create a moderately deep directory path (~8-10 levels) on any filesystem. Place several thousand files in the deepest directory. Run any application that queries IShellItem::GetAttributes (or equivalent, e.g. via IShellFolder::BindToObject/GetAttributesOf) once per file while enumerating that directory — a Qt5 QFileDialog-based file picker with custom icon/grouping logic reliably triggers it. Observe severe slowdown proportional to file count × path depth, compared to native Windows behavior with the same file count. System details in attachement. Further testing will be done shortly hopefully with the development version. -- 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.