#35572: Improve performance replacing os.listdir() with os.scandir()
-------------------------------------+-------------------------------------
     Reporter:  Paolo Melchiorre     |                    Owner:  Marcus
         Type:                       |  Vinicius Araujo
  Cleanup/optimization               |                   Status:  assigned
    Component:  Core (Other)         |                  Version:  dev
     Severity:  Normal               |               Resolution:
     Keywords:  scandir listdir      |             Triage Stage:  Accepted
  python os                          |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Comment (by Natalia Bidart):

 After reviewing this ticket, the relevant documentation, and the PR, I
 remain unconvinced of the benefits of this change. Given Tim's question
 and answer (specifically, that only `manage_translations.py` requires file
 type or file attribute information) the proposed change seems to add an
 extra level of indentation to the code without a clear benefit.

 Basic performance tests show only minimal improvements. In accordance with
 our [https://docs.djangoproject.com/en/dev/internals/contributing/bugs-
 and-features/#requesting-performance-optimizations current docs for
 requesting performance optimizations] I think we need to mark this as
 `wontfix` until a clear and substantial performance gain is demonstrated.
 The risk of breaking systems that rely on `os.listdir` (for example, via
 monkeypatching) outweighs the potential unproven benefits.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35572#comment:10>
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 view this discussion visit 
https://groups.google.com/d/msgid/django-updates/01070194f5ea4732-8471f12c-f73f-4ece-a249-4dc4a4254bf5-000000%40eu-central-1.amazonses.com.

Reply via email to