Author nh2
Recipients nh2
Date 2017-12-30.05:15:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
See 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. 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().
Date User Action Args
2017-12-30 05:15:09nh2setrecipients: + nh2
2017-12-30 05:15:09nh2setmessageid: <>
2017-12-30 05:15:09nh2linkissue32453 messages
2017-12-30 05:15:08nh2create