[Pkg-bazaar-commits] ./bzr/unstable r927: - oops, set() is much faster than intset

Martin Pool mbp at sourcefrog.net
Fri Apr 10 08:13:36 UTC 2009


------------------------------------------------------------
revno: 927
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Sun 2005-07-17 15:26:45 -0300
message:
  - oops, set() is much faster than intset
modified:
  bzrlib/intset.py
-------------- next part --------------
=== modified file 'bzrlib/intset.py'
--- a/bzrlib/intset.py	2005-07-17 18:06:38 +0000
+++ b/bzrlib/intset.py	2005-07-17 18:26:45 +0000
@@ -19,6 +19,11 @@
 # Author: Martin Pool <mbp at canonical.com>
 
 
+# Somewhat surprisingly, it turns out that this is much slower than
+# simply storing the ints in a set() type.  Python's performance model
+# is very different to that of C.
+
+
 class IntSet(Exception):
     """Faster set-like class storing only whole numbers.
 
@@ -59,7 +64,7 @@
     [10]
     
     """
-    # __slots__ = ['_val']
+    __slots__ = ['_val']
 
     def __init__(self, values=None, bitmask=0L):
         """Create a new intset.



More information about the Pkg-bazaar-commits mailing list