Improve performance of FileSystemStorage.listdir() and FilePathField with os.scandir()
Now that the minimum supported version is Python 3.5, we can replace os.listdir()
with os.scandir()
in FileSystemStorage.listdir()
and FilePathField.__init__()
to eliminate extra syscalls within the loops for improved performance.
Change History
(6)
Owner: |
changed from nobody to Federico Bond
|
Patch needs improvement: |
set
|
Triage Stage: |
Unreviewed → Accepted
|
Description: |
modified (diff)
|
Patch needs improvement: |
unset
|
Summary: |
Replace os.listdir with os.scandir in FileSystemStorage.listdir → Improve performance of FileSystemStorage.listdir() and FilePathField with os.scandir()
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
PR