#36858: Optimize `db_default` creation
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
Type: | Johnson
Cleanup/optimization | Status: closed
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls <jacobtylerwalls@…>):
* resolution: => fixed
* status: assigned => closed
Comment:
In [changeset:"2b192bff26cf956c168790fce6a637cbd814250b" 2b192bff]:
{{{#!CommitTicketReference repository=""
revision="2b192bff26cf956c168790fce6a637cbd814250b"
Fixed #36858 -- Optimized `Field._get_default()` for `db_default` case.
Create and share a single instance of `DatabaseDefault` instead of making
a new
one each time the lambda is called. The quick benchmark on the ticket
shows a
~12% speedup for a large `bulk_create()` operation.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36858#comment:3>
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/0107019bb39902bd-9b435487-91dc-48d2-bd78-df9696a04fe9-000000%40eu-central-1.amazonses.com.