On Jan 16, 7:00 pm, Javier Guerra Giraldez <jav...@guerrag.com> wrote: > On Mon, Jan 16, 2012 at 11:46 AM, Anssi Kääriäinen > > <anssi.kaariai...@thl.fi> wrote: > > I have been investigating what takes time in Django's test runner and > > if there is anything to do about it. The short answer is: yes, there > > is a lot of room for improvement. I managed to reduce the running > > speed of the test suite (on sqlite3) from 1700 seconds to around 500 > > seconds. On postgresql I reduced the run time from 5000 to 2500 > > seconds. > > doesn't 2 (model validation) and 3 (fixture loading) get skipped when > using SQLite?
I don't think those are skipped when using SQLite. For example the admin_views tests do fixture loading for every test method. Four fixtures. The fixtures are loaded using call_command. The fixture loading command (if I am not mistaken) will do model validation. Now, I am not 100% sure if fixture loading is causing model validation. The fixtures do need reload for every test case even under sqlite3. The model validation one is really easy ti test. You can test this by turning of model validation in core/management/base.py (set requires_model_validation to False) and see what difference it makes. That is what I did. Not that it is the right fix at all, but shows the time used for model validation. I tried this and got a runtime of 760 seconds. So, model validation alone is responsible for at least 200 seconds, more likely in the range of 250 seconds. Fixture loading is a problem only because the implementation will do a "cross join" of app directories, available file types (json etc) and compression types. And then check every file name combination, for every test. That is expensive. - Anssi -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.