[Zope-Checkins] CVS: Zope2 - Results.py:1.12
Jim Fulton
jim@digicool.com
Sat, 7 Apr 2001 14:18:41 -0400 (EDT)
Update of /cvs-repository/Zope2/lib/python/Shared/DC/ZRDB
In directory korak:/tmp/cvs-serv28851
Modified Files:
Results.py
Log Message:
Title: Results class optimization
At: http://classic.zope.org:8080/Collector/Collector/2141/sview
Submitter: John Eikenberry
Email: jae@kavi.com
Description: We have a large query implemented via a SQL Method. We've
been messing with it to get the most speed out of it, and noticed a
large hit in the __init__() method on the Results class. We found that
with this simple tweak (see included patch) we got around a 180% speed
up. Not a ton, but pretty good for changing 3 lines of code.
--- Updated File Results.py in package Zope2 --
--- Results.py 2000/05/23 18:57:12 1.11
+++ Results.py 2001/04/07 18:18:40 1.12
@@ -140,8 +140,9 @@
'Result record class'
r.__record_schema__=schema
- for k in filter(lambda k: k[:2]=='__', Record.__dict__.keys()):
- setattr(r,k,getattr(Record,k))
+ for k in Record.__dict__.keys():
+ if k[:2]=='__':
+ setattr(r,k,getattr(Record,k))
# Add SQL Aliases
d=r.__dict__