Rev 26: Tighten up the timing tolerances so that 'overall' time looks like query time. in http://bzr.arbash-meinel.com/plugins/history_db

John Arbash Meinel john at arbash-meinel.com
Fri Apr 2 23:20:01 BST 2010


At http://bzr.arbash-meinel.com/plugins/history_db

------------------------------------------------------------
revno: 26
revision-id: john at arbash-meinel.com-20100402221927-f7fwg6gcug5bgl2n
parent: john at arbash-meinel.com-20100402221701-t83vc338x9ycoy3n
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: history_db
timestamp: Fri 2010-04-02 17:19:27 -0500
message:
  Tighten up the timing tolerances so that 'overall' time looks like query time.
  
  It seems that Branch.unlock() is even taking 20ms or so... :(
-------------- next part --------------
=== modified file '__init__.py'
--- a/__init__.py	2010-04-02 22:17:01 +0000
+++ b/__init__.py	2010-04-02 22:19:27 +0000
@@ -120,10 +120,10 @@
         from bzrlib import branch
         import pprint
         import time
-        t = time.time()
         b = branch.Branch.open(directory)
         b.lock_read()
         try:
+            t = time.time()
             if method.startswith('db'):
                 query = history_db.Querier(db, b)
                 if method == 'db-db-id':
@@ -133,14 +133,16 @@
                 else:
                     assert method == 'db-range'
                     mainline = query.walk_mainline_using_ranges()
+                tdelta = time.time() - t
                 trace.note('Stats:\n%s' % (pprint.pformat(dict(query._stats)),))
             else:
                 assert method == 'bzr'
                 mainline = b.revision_history()
+                tdelta = time.time() - t
         finally:
             b.unlock()
         self.outf.write('Found %d revs\n' % (len(mainline),))
-        trace.note('Time: %.3fs' % (time.time() - t,))
+        trace.note('Time: %.3fs' % (tdelta,))
         # Time to walk bzr mainline
         # Outer includes the branch.open time, Query is just the time we spend
         # walking the database, etc.



More information about the bazaar-commits mailing list