#23623: ModelChoiceField generates unused temporary cache
--------------------------------------+------------------------------------
Reporter: tchaumeny | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Forms | Version: master
Severity: Normal | Keywords: ModelChoiceField,
Triage Stage: Unreviewed | admin
Easy pickings: 0 | Has patch: 1
| UI/UX: 0
--------------------------------------+------------------------------------
There is a huge memory consumption when using some admin pages with big
production datasets (see also https://groups.google.com/forum/#!topic
/django-users/YYlLWyBH_go).
I looked into the `ModelChoiceIterator` used to generate the choices for a
`ModelChoiceField`, and noticed that a temporary queryset cache was
generated.
With the proposed PR, this cache is no longer generated. After applying
the patch, I noticed that the maximum memory usage dropped from ~200MB to
~150MB for a model with about 30 000 instances.
--
Ticket URL: <https://code.djangoproject.com/ticket/23623>
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/052.aa5212f3dfa63b5dcc00ce9a77398fe4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.