Rev 4786: as_st(prefix_ref) seems to give a 1.2MB peak memory savings. in http://bazaar.launchpad.net/~jameinel/bzr/2.1-static-tuple-chk-map

John Arbash Meinel john at arbash-meinel.com
Fri Oct 23 17:10:25 BST 2009


At http://bazaar.launchpad.net/~jameinel/bzr/2.1-static-tuple-chk-map

------------------------------------------------------------
revno: 4786
revision-id: john at arbash-meinel.com-20091023161013-phm19s8n4pe27t4l
parent: john at arbash-meinel.com-20091023160453-orqt3q2e03wqcb1b
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.1-static-tuple-chk-map
timestamp: Fri 2009-10-23 11:10:13 -0500
message:
  as_st(prefix_ref) seems to give a 1.2MB peak memory savings.
  However it seems to cost 10s runtime (out of 165). interning the object does *not*
  save any memory, and costs another 7s of runtime.
-------------- next part --------------
=== modified file 'bzrlib/chk_map.py'
--- a/bzrlib/chk_map.py	2009-10-23 16:04:53 +0000
+++ b/bzrlib/chk_map.py	2009-10-23 16:10:13 +0000
@@ -1508,7 +1508,8 @@
                 #       i'm not sure if there is a big win on top of that
                 #       Also note that prefix_refs itself seems to be a pretty
                 #       short lived list.
-                prefix_refs = node._items.items()
+                prefix_refs = [as_st(item).intern()
+                               for item in node._items.iteritems()]
                 items = []
             else:
                 prefix_refs = []



More information about the bazaar-commits mailing list