Page 1 of 1

Why it takes so long to remove a file?

Posted: Sun May 08, 2016 8:52 am
by MSpagni
Let me elaborate a bit. :)
I'm comparing two HD (never heard about "backup"? :mrgreen:) with a lot (let's say 200,000) of files.
If I add or overwrite (i.e. copy) a file from a disk to the other, the operation is almost istantaneous. (Well, it depends :wink:, but let me say it takes a "normal" time.)
If I delete a file, it takes a lot of time because the list is re-sorted and then the directory list is reloaded.
Is all that work really needed for a simple delete?

Re: Why it takes so long to remove a file?

Posted: Wed May 11, 2016 5:15 pm
by psguru
These are two different scenarios. During file copy, in most cases, there's no need to refresh the whole views since they already have placeholders for copied items. During deletion list items have to be removed, and it's more complicated. There was an attempt (long time ago) to make view refresh unnecessary but it failed to cover all possible scenarios, so we reverted the code to refresh the views.

By the way, what takes long time is not typically sorting of items but rather filling the list views. And even with thousands of items it takes very little, unless, of course, you are dealing with hundreds of thousands or millions of files.

Re: Why it takes so long to remove a file?

Posted: Thu May 12, 2016 12:27 pm
by MSpagni
By the way, what takes long time is not typically sorting of items but rather filling the list views.
Yes, right.
And even with thousands of items it takes very little, unless, of course, you are dealing with hundreds of thousands or millions of files.
Well, in my case we are talking of about 3..5 seconds, and when you're removing many (groups of) files the thing quickly becomes tedious.

So, there's really no simple way to remove items from a list other than redoing the list from scratch? :cry:

Re: Why it takes so long to remove a file?

Posted: Fri May 13, 2016 12:16 pm
by psguru
So, there's really no simple way to remove items from a list other than redoing the list from scratch?
For the current version, no other way. I would suggest that you remove multiple items at a time if possible, to reduce the number of refreshes (interestingly, for me it takes less than 1 second for about 300,000 items).

We'll review this design for the next version and see what can be done to improve performance of deletion with large number of list items.

Re: Why it takes so long to remove a file?

Posted: Fri May 13, 2016 1:41 pm
by MSpagni
Well... thank you for trying.

Re: Why it takes so long to remove a file?

Posted: Sat May 14, 2016 12:19 am
by MSpagni
One more detail: the time delay is almost independent on the number of deleted files.
This makes sense since it's not the deletion itself that causes the delay.
Unless, of course, you remove a significant part of the files! 8)