Opened 6 years ago
Last modified 6 years ago
#29689 closed Cleanup/optimization
Improve performance of FileSystemStorage.listdir() and FilePathField with os.scandir() — at Version 4
Reported by: | Federico Bond | Owned by: | Federico Bond |
---|---|---|---|
Component: | File uploads/storage | Version: | 2.1 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
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 (4)
comment:1 by , 6 years ago
Owner: | changed from | to
---|
comment:3 by , 6 years ago
Patch needs improvement: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:4 by , 6 years ago
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 |
Note:
See TracTickets
for help on using tickets.
PR