#24397: Speed up model rendering with apps.ready = False
--------------------------------------+--------------------
     Reporter:  knbk                  |      Owner:  knbk
         Type:  Cleanup/optimization  |     Status:  new
    Component:  Migrations            |    Version:  master
     Severity:  Normal                |   Keywords:
 Triage Stage:  Unreviewed            |  Has patch:  1
Easy pickings:  0                     |      UI/UX:  0
--------------------------------------+--------------------
 Whenever a model is rendered, the cache of several values in `model._meta`
 is cleared on each known model. This has a severe performance impact when
 rendering large amounts of models.

 When `apps.ready` is `False`, the cache of model meta options is not
 cleared. This speeds up the initial rendering of the test suite
 significantly. The cache can then be cleared manually when all models are
 rendered, and `apps.ready` can be set back to`True`.

 Results timing `django.test.runner.DiscoverRunner.setup_databases`:
 {{{
 apps.ready == True  - 42 seconds
 apps.ready == False - 16 seconds
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24397>
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/047.0461e6af286af0f0f4a2f3526bb45da2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to