Rev 4706: Shave some time in btree by caching the 'extend' object. in http://bazaar.launchpad.net/~jameinel/bzr/2.1-memory-consumption

John Arbash Meinel john at arbash-meinel.com
Mon Sep 28 20:06:49 BST 2009


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

------------------------------------------------------------
revno: 4706
revision-id: john at arbash-meinel.com-20090928190643-0hof02awxufe4q0z
parent: john at arbash-meinel.com-20090914044600-dswfa4nzz3z4wrnm
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.1-memory-consumption
timestamp: Mon 2009-09-28 14:06:43 -0500
message:
  Shave some time in btree by caching the 'extend' object.
-------------- next part --------------
=== modified file 'bzrlib/_btree_serializer_pyx.pyx'
--- a/bzrlib/_btree_serializer_pyx.pyx	2009-09-14 04:46:00 +0000
+++ b/bzrlib/_btree_serializer_pyx.pyx	2009-09-28 19:06:43 +0000
@@ -234,6 +234,7 @@
             loop_counter = 0
             while loop_counter < self.ref_list_length:
                 ref_list = []
+                ref_list_extend = ref_list.extend
                 # extract a reference list
                 loop_counter = loop_counter + 1
                 if last < self._start:
@@ -262,9 +263,10 @@
                     if temp_ptr == NULL:
                         # key runs to the end
                         temp_ptr = ref_ptr
-                    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_list, self.extract_key(temp_ptr))
+                    ref_list_extend(self.extract_key(temp_ptr))
+                # ref_list = tuple(ref_list)
+                ref_list = _keys_type_c.Keys(self.key_length, *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