On 20.12.2019 12:52, Filipp Gunbin wrote: >> Filipp, please produce a backtrace during the freeze, either by using >> SIGUSR2, as Stefan suggested, or by attaching a debugger, and post the >> backtrace. > > Hi, please find the trace in the attach (it's large). Thank you. It doesn't exactly answer my question about desktop-read (did you really have an old VC-Dir buffer in that saved session?), but it shows one bottleneck. One that is even prominently decorated with an old comment saying "this is VERY inefficient". :-) Here's a patch you can try. It should help to an extent. And if it's the main bottleneck, we can optimize further, e.g. by eliminating the expand-file-name calls. But if in the end you should see one very long VC-Dir buffer, which can be a usability problem on its own.