Re: 1.3x-3x Model Instantiation Optimization

2008-01-30 Thread Ivan Illarionov
> Hm, a code running fast is really good but this solution seems to be really > experimental and hard-to-use, as well as making code kinda unreadable. It > would be great if it's implemented in next django releases to make django > fast :). Is it possible to do it? It depends on Django developers

Re: 1.3x-3x Model Instantiation Optimization

2008-01-30 Thread Jarek Zgoda
Ivan Illarionov napisał(a): > You may add this code to your Django model class and then instead of > obj = YourModelClass(title='Title', , > pub_date=datetime.datetime.now() ) > use > row = (None, 'Title',..., datetime.datetime.now()) > obj = YourModelClass.fromtuple(row) # 1.3x faster then b

Re: 1.3x-3x Model Instantiation Optimization

2008-01-30 Thread Eren Türkay
On 30 Jan 2008 Wed 03:08:02 Ivan Illarionov wrote: > And, be careful, the code is experimental, untested and relies on deep > black magic of object.__new__(class) which creates the instance > without calling __init__ Hm, a code running fast is really good but this solution seems to be really exp

1.3x-3x Model Instantiation Optimization

2008-01-29 Thread Ivan Illarionov
After discussion on Django developers group about Model.__init__(*args) deprecation I found the way to dramatically optimize instantiation of Django models. Here is a code: http://pastebin.com/m8e7e365 You may add this code to your Django model class and then instead of obj = YourModelClass(titl