Rev 3648: Make it easier to profile the btree writer time in http://bzr.arbash-meinel.com/branches/bzr/1.7-dev/btree

John Arbash Meinel john at arbash-meinel.com
Wed Aug 20 21:32:49 BST 2008


At http://bzr.arbash-meinel.com/branches/bzr/1.7-dev/btree

------------------------------------------------------------
revno: 3648
revision-id: john at arbash-meinel.com-20080820203247-12vpd1nvqhvwaexo
parent: john at arbash-meinel.com-20080820202100-hu678q27vjhcgrrl
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: btree
timestamp: Wed 2008-08-20 15:32:47 -0500
message:
  Make it easier to profile the btree writer time
modified:
  bzrlib/tests/test_btree_index.py test_index.py-20080624222253-p0x5f92uyh5hw734-13
-------------- next part --------------
=== modified file 'bzrlib/tests/test_btree_index.py'
--- a/bzrlib/tests/test_btree_index.py	2008-08-20 20:21:00 +0000
+++ b/bzrlib/tests/test_btree_index.py	2008-08-20 20:32:47 +0000
@@ -17,7 +17,6 @@
 """Tests for btree indices."""
 
 import pprint
-import time
 import zlib
 
 from bzrlib import (
@@ -282,21 +281,15 @@
         # having to flush anything out to disk.
         builder = btree_index.BTreeBuilder(key_elements=2, reference_lists=2,
                                            spill_at=100001)
-        # 100K nodes is enough to create a two internal nodes on the second level
-        tstart = time.time()
+        # 100K nodes is *just* enough to create a two internal nodes on the
+        # second level
         nodes = self.make_nodes(50000, 2, 2)
-        delta_make = time.time() - tstart
 
-        tstart = time.time()
         for node in nodes:
             builder.add_node(*node)
-        delta = time.time() - tstart
         transport = get_transport('trace+' + self.get_url(''))
-        tstart = time.time()
-        size = transport.put_file('index', builder.finish())
-        delta_flush = time.time() - tstart
+        size = transport.put_file('index', self.time(builder.finish))
         del builder
-        # print "\n  Spent %.3fs creating and %.3fs adding nodes and %.3fs flushing" % (delta_make, delta, delta_flush)
         index = btree_index.BTreeGraphIndex(transport, 'index', size)
         # Seed the metadata, we're using internal calls now.
         index.key_count()



More information about the bazaar-commits mailing list