At http://bzr.arbash-meinel.com/branches/bzr/1.8-dev/lighter_log_file

------------------------------------------------------------
revno: 3721
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: John Arbash Meinel <[EMAIL PROTECTED]>
branch nick: lighter_log_file
timestamp: Thu 2008-09-18 15:03:16 -0500
message:
  Document some other alternatives, but in the end, just go with the memory 
consuming fast 'frozenset()'
=== modified file 'bzrlib/log.py'
--- a/bzrlib/log.py     2008-09-18 19:39:47 +0000
+++ b/bzrlib/log.py     2008-09-18 20:03:16 +0000
@@ -644,6 +644,17 @@
         elif isinstance(rev_ancestry, list):
             # We can use "tuple()" here to save memory at the cost of CPU, or
             # use frozenset() which saves CPU but consumes RAM.
+            # We can also 'switch' based on the length of the ancestry.
+            # That gives the most direct control over memory versus CPU.
+            # For now, just going with the more performant frozenset()
+            # Also, note that both tuple and frozenset just reference the
+            # passed in object if they are of the same type. (Unlike list and
+            # set which create a new copy.)
+            #  if isinstance(x, tuple):
+            #    assert x is tuple(x)
+            # You have the same:
+            #  if isinstance(y, frozenset):
+            #    assert y is frozenset(y)
             rev_ancestry = frozenset(rev_ancestry)
         ancestry_values[rev] = rev_ancestry
 

-- 
bazaar-commits mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/bazaar-commits

Reply via email to