On 09/12/2011 12:15 AM, Anssi Kääriäinen wrote:
The feature could be useful if there are users loading big fixture
files regularly. Otherwise it complicates fixture loading for little
gain.

Maybe we could simply add an option to the loaddata command -- so that if someone really needs tons of fixtures for their tests it's possible to profit from bulk insertions by manually invoking loaddata from their test code. And the implementation is quite simple:

http://paste.pocoo.org/show/474602/ (doesn't cover all edge-cases yet)

I did some benchmarking with this code and it speeds up fixture loading *a lot*: http://www.chartgo.com/get.do?id=bdfe6af778 (chunksize=0 does not use `bulk_create` but `save`, and the speedups seen for chunksize=1 is because `bulk_create` is used, thus avoiding `save` overhead)

Jonas

--
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.

Reply via email to