On Thursday 07 May 2009 09:02:55 pm johnf wrote:
> On Thursday 07 May 2009 08:10:00 pm Ed Leafe wrote:
> > On May 7, 2009, at 9:57 PM, johnf wrote:
> > > Because the following section of code in dBizobj.py  takes ~40
> > > seconds to
> > > complete:
> > >
> > > for key, cursor in cursors.iteritems():
> > >                   self._CurrentCursor = key
> > >                   changedRows = self.getChangedRows(includeNewUnchanged)
> >
> >     Can you print the number of changedRows here?
> >
> > >                   for row in sorted(changedRows, reverse=True):
> > >                           self._moveToRowNum(row)
> > >                           try:
> > >                                   func(*args, **kwargs)
> > >                           except StandardError, e:
> > >                                   # Reset things and bail
> > >                                   dabo.errorLog.write(_("Error in 
> > > scanChangedRows: %s") % e)
> > >                                   self._CurrentCursor = 
> > > old_currentCursorKey
> > >                                   self._positionUsingPK(old_pk)
> > >                                   raise
> >
> >     If you want to run this with profiling on, I'd be interested in
> > knowing why a simple cancel is taking so long. Does this bizobj have
> > lots of child bizobjs?
> >
> >
> > -- Ed Leafe
>
> print changedRows
> [0]
> []
>
> The table session has 1586 records, two joins, and two children.

Profile output
scanChangedRows (/home/johnf/downloads/dabo/dabo/biz/dBizobj.py:742)
function called 3 times

         4547899 function calls (4547897 primitive calls) in 63.520 CPU 
seconds

   Ordered by: cumulative time, internal time, call count
   List reduced from 159 to 40 due to restriction <40>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
      3/1    0.000    0.000   63.520   63.520 dBizobj.py:742(scanChangedRows)
        1    0.000    0.000   63.520   63.520 profile:0(<function 
scanChangedRows at 0x84c6c34>)
        1    0.028    0.028   63.508   63.508 dBizobj.py:694(scanRows)
        2    0.000    0.000   63.508   31.754 dBizobj.py:632(getChangedRows)
        1    0.000    0.000   63.508   63.508 dBizobj.py:678(scan)
     1569    0.052    0.000   62.104    0.040 dBizobj.py:1137(_moveToRowNum)
     3142    0.092    0.000   61.948    0.020 dBizobj.py:1316
(setCurrentParent)
     3146    0.040    0.000   61.020    0.019 dBizobj.py:2016
(_setCurrentCursor)
     3134    0.352    0.000   60.964    0.019 dBizobj.py:142(createCursor)
     3134    0.256    0.000   50.015    0.016 dBizobj.py:1929
(_syncCursorProps)
     3134    0.100    0.000   46.823    0.015 dCursorMixin.py:2567(_setTable)
     3134    0.192    0.000   46.663    0.015 dCursorMixin.py:1964(getFields)
     3134    1.516    0.000   45.843    0.015 dbPostgreSQL.py:143(getFields)
     3134    6.876    0.002   36.354    0.012 dCursorMixin.py:283(execute)
   310266    8.408    0.000   22.641    0.000 dCursorMixin.py:192
(_correctFieldType)
     6268    0.060    0.000   11.809    0.002 dConnection.py:47(getCursor)
     6268    0.092    0.000   11.621    0.002 dBackend.py:70(getCursor)
     6268    0.176    0.000   11.529    0.002 dBizobj.py:193(__init__)
    12536    0.156    0.000   11.301    0.001 :0(apply)
     6268    0.204    0.000   10.945    0.002 dCursorMixin.py:23(__init__)
     6268    0.364    0.000    9.529    0.002 dObject.py:36(__init__)
     6268    0.128    0.000    8.389    0.001 propertyHelperMixin.py:49
(_extractKeywordProperties)
     6268    3.420    0.001    8.249    0.001 propertyHelperMixin.py:252
(getPropertyList)
     3134    3.456    0.001    6.688    0.002 dCursorMixin.py:1090(getDataSet)
   209978    3.048    0.000    6.072    0.000 :0(decode)
   216246    3.808    0.000    5.996    0.000 dCursorMixin.py:2470
(_getEncoding)
   209978    1.828    0.000    3.024    0.000 utf_8.py:15(decode)
     3134    0.940    0.000    2.808    0.001 extras.py:57(fetchall)
    21938    0.472    0.000    2.660    0.000 dCursorMixin.py:2371
(_getAuxCursor)
    37608    2.652    0.000    2.652    0.000 :0(dir)
   333791    2.628    0.000    2.628    0.000 :0(isinstance)
   404287    2.588    0.000    2.588    0.000 :0(append)
     3134    0.044    0.000    2.144    0.001 dCursorMixin.py:2360
(_setAutoPopulatePK)
   310266    2.068    0.000    2.068    0.000 extras.py:108(__getitem__)
   103422    1.348    0.000    1.776    0.000 extras.py:104(__init__)
     6276    0.124    0.000    1.716    0.000 dBizobj.py:936
(getParentLinkValue)
     6276    0.176    0.000    1.516    0.000 dBizobj.py:1467(getFieldVal)
     1568    0.004    0.000    1.380    0.001 dBizobj.py:649(_listChangedRows)
     1568    0.072    0.000    1.376    0.001 dBizobj.py:1216(isChanged)
   266390    1.324    0.000    1.324    0.000 dCursorMixin.py:2394
(_getBackendObject)


-- 
John Fabiani

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to