Page 1 of 1

0.82: Delete files slow

Posted: Tue Dec 13, 2016 1:01 am
by C1879
When I'm viewing a folder with a few thousand files, I sometimes multiple select a few hundred files via shift right arrow. If I delete those files by hitting the delete key, XnViewMP goes CPU bound for several seconds to a minute.

I grabbed Process Monitor from http://www.sysinternals.com to try to get some insight into the problem. As expected, XnViewMP moved the files to my recycle bin. But then it did the following:

Loop
QueryDirectory of all the files in the current folder

Loop hundreds of times
RegOpenKey HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\CPC\Volume SUCCESS Desired Access: Read
RegQueryKey HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\CPC\Volume SUCCESS Query: HandleTags, HandleTags: 0x0
RegOpenKey HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\CPC\Volume\{f
RegCloseKey HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\CPC\Volume SUCCESS
RegQueryValue HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\CPC\Volume\{f4ba03b0-de78-44ea-965c-70812c25a660}\Generation SUCCESS Type: REG_DWORD, Length: 4, Data: 3
RegCloseKey HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\CPC\Volume\{f4ba03b0-de78-44ea-965c-70812c25a660} SUCCESS
End Loop

End Loop

I understand that XnViewMP doesn't call these Windows API directly. But it almost seems as thought it is querying the entire current folder once for each file I deleted. That seems very inefficient.

Comments?

Re: 0.82: Delete files slow

Posted: Fri Dec 16, 2016 10:34 am
by xnview
C1879 wrote:When I'm viewing a folder with a few thousand files, I sometimes multiple select a few hundred files via shift right arrow. If I delete those files by hitting the delete key, XnViewMP goes CPU bound for several seconds to a minute.
i've tried with a slow drive, and it takes only some seconds, do you have a big catalog file?
Loop
QueryDirectory of all the files in the current folder
It seems to be called by the windows function that deletes in recycle bin

Re: 0.82: Delete files slow

Posted: Fri Dec 16, 2016 6:17 pm
by C1879
My drive is an SSD drive (Samsung 850 EVO). My machine has 64GB RAM, so all folders I touch get cached.

It seems that the problem is related to the fact that this folder has 1100 sub-folders. They were all empty. If I delete those sub-folders, performance is fine.

Re: 0.82: Delete files slow

Posted: Sun Dec 18, 2016 12:43 pm
by xnview
C1879 wrote:It seems that the problem is related to the fact that this folder has 1100 sub-folders. They were all empty. If I delete those sub-folders, performance is fine.
right the problem is with many sub folders
See Issue 1038 for details.

Re: 0.82: Delete files slow

Posted: Tue Feb 07, 2017 8:31 pm
by helmut
This problem is supposed to be fixed in XnView MP 0.84 final. Could you please try and confirm the bug fix, C1879?

Re: 0.82: Delete files slow

Posted: Sun Feb 12, 2017 1:52 am
by C1879
helmut wrote:This problem is supposed to be fixed in XnView MP 0.84 final. Could you please try and confirm the bug fix, C1879?
It works for me now. Thanks.