Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

os.walk() and glob.glob() used *only* stat(), opendir() and readdir() syscalls 
(and stat() syscalls dominated). The effect of reducing the number of the 
stat() syscalls is significant. shutil.rmtree() uses also the unlink() syscall. 
Since it is usually cheap (but see issue32453), the benefit still is good, but 
not such large. Actually I had concerns about using scandir() in 
shutil.rmtree().

shutil.copytree() needs to open, read, and write files. This is not so cheap, 
and the benefit of reducing the number of the stat() syscalls is hardly noticed 
in real cases. shutil.copytree() was not converted to using scandir() 
intentionally.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33695>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to