script = RunScanBranches()
- script.lock_and_run()
+ import os
+ all_names = os.listdir('.')
+ index = 0
+ fname = 'scan-branches-%04i.profile' % index
+ while fname in all_names:
+ index += 1
+ fname = 'scan-branches-%04i.profile' % index
+ cProfile.run('script.lock_and_run()', fname)
for this branch: for this branch
bzr+ssh://bazaar.launchpad.net/~ramana/gcc-linaro/fix-lp-838994/
shows that approximately 50% (604s) of the total run time (1196s)
is spent in Storm. (note: of this time, only 268s are spent in
psycopg2._psycopg.cursor.execute(), and 417s in
storm.database.raw_execute())
The only obvious hotspot I am seeing is the method
acquireRevisionAuthor() in lp.code.mode.revision, which needs
464s.
Danilo dug up several OOPSes, where the timeout errors always
occur in methods called by planDatabaseChanges(). Interestingly,
this method has a runtime of only 4.3s in my test run.
Running a version of cronscripts/ scan_branches. py modified for profiling:
--- cronscripts/ scan_branches. py 2011-06-20 20:07:33 +0000 scan_branches. py 2011-10-10 11:13:03 +0000
+++ cronscripts/
@@ -8,11 +8,12 @@
__metaclass__ = type
import _pythonpath
+import cProfile
from lp.code. interfaces. branchjob import IBranchScanJobS ource job.runner import (
from lp.services.
JobCronScript,
- TwistedJobRunner,
+ JobRunner,
)
@@ -23,10 +24,17 @@ interface = IBranchScanJobS ource
source_
def __init__(self): anches, self)._ _init__ (runner_ class=TwistedJo bRunner) anches, self)._ _init__ (runner_ class=JobRunner )
- super(RunScanBr
+ super(RunScanBr
if __name__ == '__main__':
script = RunScanBranches() lock_and_ run() %04i.profile' % index %04i.profile' % index run('script. lock_and_ run()', fname)
- script.
+ import os
+ all_names = os.listdir('.')
+ index = 0
+ fname = 'scan-branches-
+ while fname in all_names:
+ index += 1
+ fname = 'scan-branches-
+ cProfile.
for this branch: for this branch //bazaar. launchpad. net/~ramana/ gcc-linaro/ fix-lp- 838994/
bzr+ssh:
shows that approximately 50% (604s) of the total run time (1196s) _psycopg. cursor. execute( ), and 417s in raw_execute( ))
is spent in Storm. (note: of this time, only 268s are spent in
psycopg2.
storm.database.
The only obvious hotspot I am seeing is the method Author( ) in lp.code. mode.revision, which needs
acquireRevision
464s.
Danilo dug up several OOPSes, where the timeout errors always nges(). Interestingly,
occur in methods called by planDatabaseCha
this method has a runtime of only 4.3s in my test run.