Hi all,
My web application sends a medium size data grid (20 elements). I was using formsets for the same.
The issue I am facing is that the formset instantiation is very very slow. I timed it and it is taking ~4-7 seconds for it to instantiate.
Is there someway the speed can be increased?
There are no files sent. I am planning to, later.
The code:
logging.info('Start - %s' %time.clock())
DataFormSet = formset_factory(DataForm, extra=25)
logging.info('Formset Class created- %s' %time.clock())
formset = DataFormSet(request.POST, request.FILES)
logging.info('Created new formset- %s'%time.clock())
From my logs:
2009-01-06 22:53:30,671 INFO Start - 0
2009-01-06 22:53:30,671 INFO Formset Class created- 0.000403403225829
2009-01-06 22:53:34,296 INFO Created new formset- 3.62182316468
or later
2009-01-06 22:56:37,500 INFO Start - 186.836136716
2009-01-06 22:56:37,500 INFO Formset Class created- 186.836445135
2009-01-06 22:56:43,108 INFO Created new formset- 192.440754621
Please note that I am running the whole thing under the django development server in my laptop itself and not a server.