--
Ticket URL: <https://code.djangoproject.com/ticket/29689>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* owner: nobody => Federico Bond
--
Ticket URL: <https://code.djangoproject.com/ticket/29689#comment:1>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/29689#comment:2>
* needs_better_patch: 0 => 1
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/29689#comment:3>
* 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>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"a0ca4b5694f43c63ea13ba6908eff2bd53ee7ebb" a0ca4b56]:
{{{
#!CommitTicketReference repository=""
revision="a0ca4b5694f43c63ea13ba6908eff2bd53ee7ebb"
Fixed #29689 -- Improved performance of FileSystemStorage.listdir() and
FilePathField with os.scandir().
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29689#comment:5>
Comment (by Tim Graham <timograham@…>):
In [changeset:"54b331451cb22ee354beadf31ee42cbd714877f0" 54b33145]:
{{{
#!CommitTicketReference repository=""
revision="54b331451cb22ee354beadf31ee42cbd714877f0"
Refs #29689 -- Moved FilePathField choices sorting outside the loop.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29689#comment:6>