Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fast Delete #1643

Open
azchohfi opened this issue Mar 20, 2020 · 20 comments
Open

Fast Delete #1643

azchohfi opened this issue Mar 20, 2020 · 20 comments
Labels
Idea-New PowerToy Suggestion for a PowerToy Product-File Actions Menu Refers to the File Actions Menu module Product-File Explorer Power Toys that touch explorer like Preview Pane
Milestone

Comments

@azchohfi
Copy link
Contributor

Summary of the new feature/enhancement

If you want to delete a lot of files (large number of files, not large files) thru File Explorer, right now it is a very slow process, compared to doing the same thru the command line.

Proposed technical implementation details (optional)

I would like to have a power option that enabled me to fast delete a selection of files from Explorer. Pretty much what this provides:
https://www.ghacks.net/2017/07/18/how-to-delete-large-folders-in-windows-super-fast/
Which is pretty much this:
DEL /F/Q/S *.* > NUL
That would be much better than typing the command!

@crutkas crutkas added Idea-New PowerToy Suggestion for a PowerToy Help Wanted We encourage anyone to jump in on these and submit a PR. labels Mar 20, 2020
@crutkas
Copy link
Member

crutkas commented Mar 20, 2020

I love this idea

@wjk
Copy link
Contributor

wjk commented Mar 31, 2020

I’d love to take a stab at this one.

@crutkas
Copy link
Member

crutkas commented Mar 31, 2020

@wjk, do you want me to assign it to you?

@wjk
Copy link
Contributor

wjk commented Mar 31, 2020

Yes please.

@crutkas crutkas assigned wjk and andrewhwng and unassigned andrewhwng Mar 31, 2020
@crutkas
Copy link
Member

crutkas commented Mar 31, 2020

done and done :) I'd imagine this would be part of the "File Explorer" section, fyi for enabling / disabling

@kapsiR
Copy link

kapsiR commented Sep 3, 2020

@wjk Any progress here so far?
I think this could be part of the Hacktoberfest 2020 😉

Just to have the PowerShell version documented, e.g.:
Remove-Item .\node_modules\ -Force -Recurse

@wjk
Copy link
Contributor

wjk commented Sep 3, 2020

@kapsiR I immediately ran into problems setting up the UI for this feature. Writing a shell extension according to the spec — that’s easy. Getting it integrated into PowerToys’ settings UI in the many disparate ways that are required — that's hard. The documentation and code here really needs a rewrite. I haven't touched this in months. Sorry about that!

@crutkas
Copy link
Member

crutkas commented Sep 3, 2020

@wjk, please reach out if you have any issues. Lets fix both the collaboration docs fixed as well as get this added in.

Either here or [email protected]

@crutkas
Copy link
Member

crutkas commented Sep 3, 2020

always remember, programming is a team sport, never go it alone

@wjk wjk mentioned this issue Sep 3, 2020
5 tasks
@crutkas crutkas modified the milestones: Suggested Ideas, Help Wanted Sep 14, 2020
@Hurstwood
Copy link

Hurstwood commented Oct 13, 2020

If you want to delete a lot of files (large number of files, not large files) thru File Explorer, right now it is a very slow process, compared to doing the same thru the command line.

The article you linked to states "It may take ten or twenty minutes, or even longer, to delete a large folder using Explorer on Windows devices.".

Recycling items/deleting items to the recycle bin is super slow. 'Perminant' delete is fast. To perminantly delete, select the files and press shift and del at the same time.

I've just tested this now on my SSD to make sure i wasn't talking nonsense as i don't think about it anymore.
It took over 5 minutes to copy 6200 files (10GB) to a new directory. A shift and del perminant delete, deleted all of the files within 20 seconds from when i pressed the buttons on the keyboard to when the dialog box disappeared after it had finished.

Looking at the docs https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/del
It appears that cmd del 'perminantly' deletes files too.

Without doing a speed comparison, i imagine they're both similar in speed.

@enricogior
Copy link
Contributor

enricogior commented Nov 4, 2020

I did the following test using the PowerToys repo after a full build as test folder to delete:

image

I used a mechanical SATA drive, after creating the test folders and after rebooting Windows to make sure nothing was in the Windows cache:
DEL /F/Q/S *.* > NUL took about 24 seconds, note that it didn't delete the 4,000 folders, only the files.
Shift + Delete from Explorer took about 29 seconds and deleted all the files and folders.

The difference doesn't seem to justify a new PowerToys module with all the work that will require to maintain and support it.
We are a very small team, if something is not a game changer, we should have a conservative approach before adding new functionality.

@crutkas
Copy link
Member

crutkas commented Nov 4, 2020

@wjk did you ever do some speed tests for this?

@wjk
Copy link
Contributor

wjk commented Nov 4, 2020

@crutkas I'm afraid I didn't. Things have gotten rather busy due to my university schedule. I do agree with @enricogior that this tool might well be unnecessary. If you want to close this issue and the associated PR for this reason, I'm perfectly OK with that. Thanks!

@enricogior
Copy link
Contributor

@wjk
OK I'll close the PR and the issue, sorry for not having done more research ahead.
Next time we'll try to do a better job, you are always welcomed to contribute to the project.

@enricogior enricogior added Resolution-Won't fix and removed Help Wanted We encourage anyone to jump in on these and submit a PR. labels Nov 4, 2020
@crutkas
Copy link
Member

crutkas commented May 13, 2021

@enricogior, i just did this on two sets of PT clones after a full compile.

12 gigs with about 75k files

21 seconds <- directly running DEL /F/Q/S . > NUL
51 seconds <- shift delete

Speed wise, this is pretty drastic

@crutkas crutkas reopened this May 13, 2021
@enricogior
Copy link
Contributor

@crutkas
you have to test it against the exact same data after a reboot, otherwise you can get very different results.
When I did the test, I did it multiple times and on both SATA harddrives and PCIe SSDs.

@crutkas
Copy link
Member

crutkas commented May 13, 2021

this was exact same data. Base folder was copied to two new dirs on same drive on a SSD not on my c drive.

@enricogior
Copy link
Contributor

@crutkas
unless you reboot, part of the data is cached and the results will be affected by that.
Also you cannot do the test "in parallel" since different data location can also affect the results.
Also, different version of Windows might affect the results.
It's tricky to get consistent data.

@crutkas
Copy link
Member

crutkas commented May 13, 2021

was not done in parallel. Did test 1 then test 2. happy to do multiple tests and average but i think 'real world' is critical.

@enricogior
Copy link
Contributor

@crutkas
what I mean, is that the entire test must be serialized, including the data creation:

  1. generate the data in a consistent manner (for example copy it form an external source)
  2. reboot the machine
  3. delete the data with method 1
  4. repeat the test for method 2 starting from step 1.

In other words, the data should be recreated after each test, it should not be created for both tests and then run the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Idea-New PowerToy Suggestion for a PowerToy Product-File Actions Menu Refers to the File Actions Menu module Product-File Explorer Power Toys that touch explorer like Preview Pane
Projects
None yet
Development

No branches or pull requests

8 participants