I sometimes need to mass delete large numbers of small image files or empty the recycle bin in my Android phone (Google Pixel 8).
A typical case would be deleting 100 thumbnails produced by some app, each 10 KB in size for a total of 1MB.
When I do this via adb and terminal commands, it takes very little time, most often less than a second. But if I use the photos app on the phone to empty the recycle bin or select many images and then delete, it can take 20-30 seconds or even more.
Why is it so slow? What does it do in addition to deleting the files, that takes so long, even for very small files?
It’s slow because the Photos app doesn’t just delete files. For every image it updates the media database, handles trash/undo, checks permissions, cleans caches, and syncs state with the system (and possibly the cloud). this happens even for tiny files.
adb rm skips all of this and just removes the files directly, so it’s almost instant.
Sabyasachi