#29689: Improve performance of FileSystemStorage.listdir() and FilePathField
with
os.scandir()
-------------------------------------+-------------------------------------
Reporter: Federico Bond | Owner: Federico
Type: | Bond
Cleanup/optimization | Status: assigned
Component: File | Version: 2.1
uploads/storage |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):
* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin
Old description:
> Now that the minimum supported version is Python 3.5, we can replace
> os.listdir with os.scandir in `FileSystemStorage.listdir` for improved
> performance.
New description:
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.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/29689#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/070.ce7a03f7fa4581fec8154ad439eda38b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.