Rev 4705: Changing ref_lists back into using tuple([Key1, Key2]) rather than Keys() in http://bazaar.launchpad.net/~jameinel/bzr/2.1-memory-consumption

John Arbash Meinel john at arbash-meinel.com
Mon Sep 14 05:46:17 BST 2009


At http://bazaar.launchpad.net/~jameinel/bzr/2.1-memory-consumption

------------------------------------------------------------
revno: 4705
revision-id: john at arbash-meinel.com-20090914044600-dswfa4nzz3z4wrnm
parent: john at arbash-meinel.com-20090914044222-a1nnzosoosefb2sd
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.1-memory-consumption
timestamp: Sun 2009-09-13 23:46:00 -0500
message:
  Changing ref_lists back into using tuple([Key1, Key2]) rather than Keys()
  brings us down to 648ms.
  
  So obviously there is a lot to be gained by improving the Keys constructor,
  and possibly the on-demand creation of Key objects from Keys is killing performance.
-------------- next part --------------
=== modified file 'bzrlib/_btree_serializer_pyx.pyx'
--- a/bzrlib/_btree_serializer_pyx.pyx	2009-09-14 04:42:22 +0000
+++ b/bzrlib/_btree_serializer_pyx.pyx	2009-09-14 04:46:00 +0000
@@ -262,8 +262,9 @@
                     if temp_ptr == NULL:
                         # key runs to the end
                         temp_ptr = ref_ptr
-                    ref_list.extend(self.extract_key(temp_ptr))
-                ref_list = _keys_type_c.Keys(self.key_length, *ref_list)
+                    PyList_Append(ref_list, self.extract_key(temp_ptr))
+                # ref_list = _keys_type_c.Keys(self.key_length, *ref_list)
+                ref_list = tuple(ref_list)
                 PyList_Append(ref_lists, ref_list)
                 # prepare for the next reference list
                 self._start = next_start



More information about the bazaar-commits mailing list