#19501: Allow for fast path model loading
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: akaariai
Type: | Status: new
Cleanup/optimization | Version: master
Component: Database layer | Resolution:
(models, ORM) | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
Keywords: | Patch needs improvement: 1
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Comment (by akaariai):
See PR https://github.com/django/django/pull/2802 for a basic
implementation.
The cost of this is 10% slower query_all benchmark, and around 15% slower
query_select_related benchmark (these fetch large amount of objects and do
nothing else). OTOH, using the new hook it will be possible to speed up
model loading dramatically (query_all is 1.7x faster with direct __dict__
assignment).
My feeling is that if you have a bottleneck due to model instantiation
speed, then you want this patch so that you can optimize the way your
models are loaded. If you don't have a bottleneck in model instantiation,
then you don't care about the 10% in any case.
--
Ticket URL: <https://code.djangoproject.com/ticket/19501#comment:6>
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/066.fae241080078b62410abf505f6ac94e8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.