Re: [Sqlalchemy-tickets] [sqlalchemy] #2720: new C extensions for attribute accessing
Brought to you by:
zzzeek
|
From: sqlalchemy <mi...@zz...> - 2013-05-08 01:23:04
|
#2720: new C extensions for attribute accessing
-----------------------------------+---------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: enhancement | Status: new
Priority: medium | Milestone: 0.9.0
Component: cextensions | Severity: very major - up to 2 days
Resolution: | Keywords:
Progress State: not decided upon |
-----------------------------------+---------------------------------------
Comment (by claudiofreire):
No, it's not that at all. What it's doing, is try to get the __dict__, for
comparison against the instance_dict() return value. Caching (which is
what accelerates things) is only enabled when:
{{{instance_dict(instance) is instance.__dict__}}}
and
{{{self.impl.get(instance_state(instance), dict_)}}} is successful (ie: no
errors).
If both happen, then from that point onwards, all attribute accesses of
that kind (ie: {{{Entity.id}}} for all instances of Entity) will shortcut
directly towards {{{instance.__dict__[self.key]}}}, as long as
{{{globals()['instance_dict']}}} hasn't changed.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2720#comment:13>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|