Author nh2
Recipients nh2
Date 2017-12-30.05:15:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1514610909.88.0.213398074469.issue32453@psf.upfronthosting.co.za>
In-reply-to
Content
See http://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=24412edeaf556a for the explanation and equivalent fix in coreutils.

The gist ist that deleting entries in inode order can improve deletion performance dramatically.

To obtain inode numbers and sort by them, one needs to `getdents()` all the entries ahead of time, but rmtree() already gets all dirents ahead of the deletion. https://bugs.python.org/issue28564 recently improved shutil.rmtree() performance by using scandir(), but nevertheless the returned generator is list()ed, so we already have all necessary informtaion in memory and would just have to perform an O(n) integer sort.

I propose we check if the improvements made to `rm -r` in coreutils should be ported to shutil.rmtree().
History
Date User Action Args
2017-12-30 05:15:09nh2setrecipients: + nh2
2017-12-30 05:15:09nh2setmessageid: <1514610909.88.0.213398074469.issue32453@psf.upfronthosting.co.za>
2017-12-30 05:15:09nh2linkissue32453 messages
2017-12-30 05:15:08nh2create