﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
3438	django.db.models.base.__init__ refactoring	(removed)	Adrian Holovaty	"Short version; for iteration over records, there model's __init__ is rather unfriendly to the way the args are passed in.

At least for sqlite, the sql row is passed in as args- issue is that __init__ shoots through self._model.fields playing with kwargs prior, doing rather costly exception catching, pulling default values, etc, then *finally* does args processing.

If you're dealing in one or two records, this doesn't show up much, but if you're dealing in 53k records (my usage is slightly weird admittedly), it's a pretty heavy slow down.

attached is a patch to refactor __init__, knocking around a third off the __init__ cost via refactoring the args/kwargs processing, essentially reversing the actual flow while maintaining the same behaviour as before.

Have been using it for a few days, and passes tests; comments welcome, mainly since I need to get this integrated for my uses."		closed	Core (Other)	dev		fixed			Unreviewed	1	0	0	0	0	0
