[issue32453] shutil.rmtree can have O(n^2) performance on large dirs

Niklas Hambüchen report at bugs.python.org
Sat Oct 30 08:33:10 EDT 2021


Niklas Hambüchen <nh2 at deditus.de> added the comment:

A small update / summary so far:

>From here this developed into coreutils discussion:

    #29921 O(n^2) performance of rm -r
    https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29921

and finally a `linux-fsdevel` discussion:

    O(n^2) deletion performance
    https://lore.kernel.org/linux-fsdevel/5ca3808d-4eea-afec-75a6-2cc41f44b868@nh2.me/t/#u

Dave Chinner (xfs dev) suggests that on XFS there is no quadratic behaviour once  the problem is bound by seek-time of the spinning disk.

Somebody should try to confirm that it becomes linear in even larger tests, e.g. way larger than 21 minutes deletion time.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32453>
_______________________________________


More information about the Python-bugs-list mailing list