XY calls the shell, so as far as a user is concerned it is XY.admin wrote:Interesting result! But note that it's not XY scanning the bin, it's the Shell!
And that's the problem...admin wrote:As I said before, XY is just sitting there and waits for the Shell to return.
In Windows Explorer the operation is modeless all this enumerating is happening in a background thread and the user can continue to work.
In XY it's blocking, so the user must wait for the shell to finish before anything can be done, regardless of the Progress Dialog Modeless setting.
It appears that WE uses 2 threads (both starting in SHLWAPI.dll) to perform the request, presumably 1 handles the delete/progress and the other does the enumerating. XY only spawns 1.
It's more dependent on the number of folders and subfolders, watch it in ProcMon - it walks the tree of the recycle bin enumerating the deleted tree(s).admin wrote:And there must be another factor. I'm on XP with 6000+ items in my bin and there's no delay at all, nada!
Using this as a test (after generating 100 empty text files obviously):
Code: Select all
::$i=0;$result="";while($i<100){$i++;$start="<date>";Delete(1,0, ":list");$result="$result<crlf>$i - " . DateDiff("$start",,"s");}Text($result);
With a recycle bin containing 1 item a folder (DelRoot), whose content is structured as "DelRoot\0\1\2\3\4\5\6\7\8\9\" and each level also contains 500 files, thus 5500 files in 11 nested folders, the time per delete was 3 to 13 seconds with an average of 3.69.
The more folders you delete the worse it gets.
With 6326 objects (which is actually 51419 items, sorry I didn't track the folders/files): average 11 seconds, ranging from 7-38. That's XY blocking (and as far as the user cares hanging) for 7 to 38 seconds to delete a single empty file!
Obviously I can't give you a good comparison in WE for the same scenarios, but it doesn't matter because I'm always able to continue working. As far as the user is concerned it could take two days to enumerate the recycle bin, but the file is deleted and they are on to the next task much quicker.