Why it takes so long to remove a file?

General questions about using ExamDiff Pro, ideas for new features, bug reports, and usage tips.
Post Reply
MSpagni
Expert Member
Posts: 539
Joined: Mon Mar 30, 2009 12:53 am
Location: Italy

Why it takes so long to remove a file?

Post 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?
User avatar
psguru
Site Admin
Posts: 2231
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

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

Post 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.
psguru
PrestoSoft
MSpagni
Expert Member
Posts: 539
Joined: Mon Mar 30, 2009 12:53 am
Location: Italy

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

Post 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:
User avatar
psguru
Site Admin
Posts: 2231
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

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

Post 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.
psguru
PrestoSoft
MSpagni
Expert Member
Posts: 539
Joined: Mon Mar 30, 2009 12:53 am
Location: Italy

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

Post by MSpagni »

Well... thank you for trying.
MSpagni
Expert Member
Posts: 539
Joined: Mon Mar 30, 2009 12:53 am
Location: Italy

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

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