Re: [Sqlalchemy-tickets] [sqlalchemy] #2720: new C extensions for attribute accessing
Brought to you by:
zzzeek
|
From: sqlalchemy <mi...@zz...> - 2013-05-08 14:58:55
|
#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):
Ok, timeit.
This is the test:
{{{
>>> def test():
... for _ in xrange(10):
... _ = rc.hash
... _ = rc.hash
... _ = rc.hash
... _ = rc.hash
... _ = rc.hash
... _ = rc.hash
... _ = rc.hash
... _ = rc.hash
... _ = rc.hash
... _ = rc.hash
... _ = rc.hash
... _ = rc.hash
... _ = rc.hash
... _ = rc.hash
... _ = rc.hash
... _ = rc.hash
...
}}}
Yeah, I did it on the console, and yeah, I made sure both runs contained
the same number of rc.hash lines.
With cinstrumented:
{{{
>>> timeit.timeit(test)
156.2858281135559
}}}
Without cinstrumented:
{{{
>>> timeit.timeit(test)
188.22997498512268
}}}
Unsurprising.
PS: I did not include a query in the timeit function because I'm working
with a remote DB ATM, and it'd overshadow attribute access. I don't have a
local db handy.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2720#comment:17>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|