0.82: Delete files slow

Bugs and Suggestions in XnView MP or XnConvert MP which have been resolved.

Moderators: XnTriq, helmut, xnview

Post Reply
C1879
Posts: 4
Joined: Tue Jul 19, 2016 10:14 pm

0.82: Delete files slow

Post 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?
User avatar
xnview
Author of XnView
Posts: 43326
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.82: Delete files slow

Post 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
Pierre.
C1879
Posts: 4
Joined: Tue Jul 19, 2016 10:14 pm

Re: 0.82: Delete files slow

Post 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.
User avatar
xnview
Author of XnView
Posts: 43326
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.82: Delete files slow

Post 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.
Pierre.
User avatar
helmut
Posts: 8705
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: 0.82: Delete files slow

Post 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?
C1879
Posts: 4
Joined: Tue Jul 19, 2016 10:14 pm

Re: 0.82: Delete files slow

Post 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.
Post Reply