[Modeling-users] ec.insert() timing
Status: Abandoned
Brought to you by:
sbigaret
|
From: Yannick G. <yan...@sa...> - 2003-09-10 21:13:57
|
=2D----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Everyone,=20
I noticed a weird slowdown recently when creating records with the
framework. I quickly scattered print statements in my code to identify
the bottle next and I fond ec.insert() to be the main culprit. This
is probably a locking problem since I have 0.1% CPU Load on MySQL,
almost 0 traffic on the network and the system is 60% idle in the peek
of a 100 record insert profiling session. The 100 record insert takes
a few minutes with a noticeable pause on the call to ec.insert() (but
no pause on the call to ec.saveChanges()).
On the profiler side everything seems OK with ec.insert() :=20
101 0.010 0.000 0.440 0.004=20
/usr/lib/python2.2/site-packages/Modeling/EditingContext.py:866(insertObjec=
t)
ec.saveChanges() seems to eat much more CPU:
102 0.090 0.001 8.290 0.081=20
/usr/lib/python2.2/site-packages/Modeling/EditingContext.py:718(saveChanges)
But as said previously, I don't notice any pause on the call to
ec.saveChanges() as I do for ec.insertObject() .
The timing code looks like this :=20
for i in range(100):
sys.stderr.write("%d\n" % i)
newRec =3D self._dbClass()
sys.stderr.write("a\n")
for key, value in self._defaults.items():
newRec.takeValueForKey(value, key)
sys.stderr.write("b\n") =20
self._ec.insert(newRec)
sys.stderr.write("c\n") =20
self._ec.saveChanges()
sys.stderr.write("d\n")
I'm using MySQL 3.23.56, Python 2.2.2 and Modeling 0.9-pre-14.
Does anyone experienced such a slowdown on inserts ?
Thanks in advance for any feed-back.
=2D --=20
Yannick Gingras
Byte Gardener, Savoir-faire Linux inc.
http://www.savoirfairelinux.com/
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQE/X5QKrhy5Fqn/MRARAo88AJ9hwIKj2h/kIT4IfAQy/kkdEXDC2ACfQvZm
p1Q0ESb0TyFPsKYWWMnAyXI=3D
=3Dc0qC
=2D----END PGP SIGNATURE-----
|