#23372: Prevent loaddata from disabling and enabling constraints when no
fixtures
are found
-------------------------------------+-------------------------------------
Reporter: manfre | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Testing framework | Version: 1.7
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 Tim Graham <timograham@…>):
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"ee9f4686b19e2b4a68f5cb4f9d61dc045c1d4c63" ee9f4686]:
{{{
#!CommitTicketReference repository=""
revision="ee9f4686b19e2b4a68f5cb4f9d61dc045c1d4c63"
Fixed #23372 -- Made loaddata faster if it doesn't find any fixtures.
Django's test suite often tries to load fixture files from apps that have
no fixtures at all. This creates a lot of unnecessary disabling and
enabling of constraints which can be expensive on some database.
To speed this up, loaddata now first checks if any fixture file matches.
If no fixture file is matched, then the command exits before disabling
and enabling of constraints is done.
The main benefit of this change is seen on MSSQL, where tests on
Django 1.8 run hours faster.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23372#comment:18>
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/064.c30b4543eaba699d6b981278b7f0d5be%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.