Support Requests item #3366899, was opened at 2011-07-14 11:40
Message generated for change (Comment added) made by phd
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540673&aid=3366899&group_id=74338
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Priority: 5
Private: No
Submitted By: Rosa Robles (marobles)
>Assigned to: Oleg Broytman (phd)
Summary: The speed of SQLObject is slower on the time
Initial Comment:
I had a test of a SQLObject and I had found a strange behaviour of SQLObject. On the time, the respond time is lesser.
Here, I put a example of test code :
from sqlobject.sqlbuilder import *
connection = connectionForURI('postgresql://test:test@localhost/test_sql_object')
sqlhub.processConnection = connection
class Person(SQLObject):
firstName = StringCol()
middleInitial = StringCol(length=1, default=None)
lastName = StringCol()
iteration = 0
while 1:
start = datetime.now()
person_list = []
for key in range(1000):
person = Person.selectBy(firstName='name%s%s' % (iteration,key))[0]
person_list.append(person)
for person in person_list:
person.expire()
del person
del person_list
sqlhub.processConnection.cache.clear()
end = datetime.now()
print "TIME ",iteration,':' , end - start
iteration = iteration + 1
In the result I can check that in each iteration the time is bigger. The first iteration has time of 1.37s, then the time increases and the 19 iteration has time of 5.83 s!
TIME 0 : 0:00:01.376392
TIME 1 : 0:00:01.663250
TIME 2 : 0:00:01.978639
TIME 3 : 0:00:02.319939
TIME 4 : 0:00:02.618213
TIME 5 : 0:00:02.723846
TIME 6 : 0:00:02.584007
TIME 7 : 0:00:02.868877
TIME 8 : 0:00:03.051937
TIME 9 : 0:00:03.389757
TIME 10 : 0:00:03.503036
TIME 11 : 0:00:03.563154
TIME 12 : 0:00:04.191539
TIME 13 : 0:00:04.274464
TIME 14 : 0:00:04.813206
TIME 15 : 0:00:04.677002
TIME 16 : 0:00:04.995708
TIME 17 : 0:00:05.126811
TIME 18 : 0:00:05.571279
TIME 19 : 0:00:05.832840
Why is happend this?
Thanks in advance for your attention.
Cheers Rosa
----------------------------------------------------------------------
>Comment By: Oleg Broytman (phd)
Date: 2011-07-14 20:56
Message:
No idea what is going on. Let's investigate a little further. What version
of SQLObject are you using? Can you add more prints inside the loop to see
what part of the program takes time?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540673&aid=3366899&group_id=74338
|