Rev 3553: (robertc) Intern GraphIndex strings and handle frozenset inputs to in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu Jul 17 08:33:25 BST 2008


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 3553
revision-id:pqm at pqm.ubuntu.com-20080717073312-reglpowwyo671081
parent: pqm at pqm.ubuntu.com-20080717070254-h8qltle17foj2pao
parent: robertc at robertcollins.net-20080717064101-6c8mko15m0xi7oqy
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2008-07-17 08:33:12 +0100
message:
  (robertc) Intern GraphIndex strings and handle frozenset inputs to
  	make_mpdiffs in the case of errors. (Robert Collins, Andrew Bennetts)
modified:
  bzrlib/index.py                index.py-20070712131115-lolkarso50vjr64s-1
  bzrlib/versionedfile.py        versionedfile.py-20060222045106-5039c71ee3b65490
    ------------------------------------------------------------
    revno: 3530.3.3
    revision-id:robertc at robertcollins.net-20080717064101-6c8mko15m0xi7oqy
    parent: robertc at robertcollins.net-20080714162908-90k3z9jj37i36e4v
    committer: Robert Collins <robertc at robertcollins.net>
    branch nick: btree-graphindex
    timestamp: Thu 2008-07-17 16:41:01 +1000
    message:
      Credit and explanation for interning.
    modified:
      bzrlib/index.py                index.py-20070712131115-lolkarso50vjr64s-1
    ------------------------------------------------------------
    revno: 3530.3.2
    revision-id:robertc at robertcollins.net-20080714162908-90k3z9jj37i36e4v
    parent: robertc at robertcollins.net-20080713194725-ovm2j4pvi5vst2zy
    committer: Robert Collins <robertc at robertcollins.net>
    branch nick: btree-graphindex
    timestamp: Tue 2008-07-15 02:29:08 +1000
    message:
      Handling frozen set inputs in mpdiff generation when a key is missing
    modified:
      bzrlib/versionedfile.py        versionedfile.py-20060222045106-5039c71ee3b65490
    ------------------------------------------------------------
    revno: 3530.3.1
    revision-id:robertc at robertcollins.net-20080713194725-ovm2j4pvi5vst2zy
    parent: pqm at pqm.ubuntu.com-20080707230506-82h5w03vc72dyf1a
    committer: Robert Collins <robertc at robertcollins.net>
    branch nick: btree-graphindex
    timestamp: Mon 2008-07-14 05:47:25 +1000
    message:
      Intern keys to reduce duplicated memory in GraphIndex parsing.
    modified:
      bzrlib/index.py                index.py-20070712131115-lolkarso50vjr64s-1
=== modified file 'bzrlib/index.py'
--- a/bzrlib/index.py	2008-07-11 06:03:27 +0000
+++ b/bzrlib/index.py	2008-07-17 07:33:12 +0000
@@ -881,8 +881,9 @@
             elements = line.split('\0')
             if len(elements) != self._expected_elements:
                 raise errors.BadIndexData(self)
-            # keys are tuples
-            key = tuple(elements[:self._key_length])
+            # keys are tuples. Each element is a string that may occur many
+            # times, so we intern them to save space. AB, RC, 200807
+            key = tuple(intern(element) for element in elements[:self._key_length])
             if first_key is None:
                 first_key = key
             absent, references, value = elements[-3:]

=== modified file 'bzrlib/versionedfile.py'
--- a/bzrlib/versionedfile.py	2008-07-14 07:39:30 +0000
+++ b/bzrlib/versionedfile.py	2008-07-17 07:33:12 +0000
@@ -893,7 +893,7 @@
                 knit_keys.update(parent_keys)
         missing_keys = keys - set(parent_map)
         if missing_keys:
-            raise errors.RevisionNotPresent(missing_keys.pop(), self)
+            raise errors.RevisionNotPresent(list(missing_keys)[0], self)
         # We need to filter out ghosts, because we can't diff against them.
         maybe_ghosts = knit_keys - keys
         ghosts = maybe_ghosts - set(self.get_parent_map(maybe_ghosts))




More information about the bazaar-commits mailing list