On Wed, 2007-06-13 at 09:37 +1000, Malcolm Tredinnick wrote:
> On Tue, 2007-06-12 at 06:16 -0700, Brian Harring wrote:
[...]
> > Model.__init__ is still a bit of a kick in the teeth offhand; 
> > addressing that one however requires some semi-nasty work shifting 
> > some of the fields related testing to be cached in _meta; not 
> > expecting a huge gain out of it, plus it'll likely be fairly nasty so 
> > I'd rather hold off on that one till a later date.
> 
> It's also going to get a little heavier (not noticable in the common
> cases, maybe noticable in the 10^6 case) with the unicode branch and
> when we add Field sub-classing (which will be very soon), since both
> require an extra function call per field in the average case. This is
> the standard trade-off: functionality costs time and the functionality
> in both cases is worth having.

Actually, before you start worrying unnecessarily, Brian, I take some of
that back. Field sub-classing can be done at a cost of no extra calls
for non-sub-classed fields. Apparently I'm schizophrenic, because the
half of me that wrote the above paragraph had not noticed when the other
half of me wrote the code that did this. It's essentially what you are
suggesting with _meta caching: keep a list of "special" fields that we
can determine as part of the metaclass's __new__ and do a run over those
for any type coercion. Normal fields are not touched.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to