Rev 4772: NEWS entry for StaticTuple class. in http://bazaar.launchpad.net/~jameinel/bzr/2.1-static-tuple-no-use

John Arbash Meinel john at arbash-meinel.com
Mon Oct 12 19:14:27 BST 2009


At http://bazaar.launchpad.net/~jameinel/bzr/2.1-static-tuple-no-use

------------------------------------------------------------
revno: 4772
revision-id: john at arbash-meinel.com-20091012181421-6s3yxopo9s40wqjr
parent: john at arbash-meinel.com-20091012181024-q21zm9xpyf62ld7t
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.1-static-tuple-no-use
timestamp: Mon 2009-10-12 13:14:21 -0500
message:
  NEWS entry for StaticTuple class.
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2009-10-12 16:15:05 +0000
+++ b/NEWS	2009-10-12 18:14:21 +0000
@@ -209,15 +209,23 @@
 * Added ``bzrlib._simple_set_pyx``. This is a hybrid between a Set and a
   Dict (it only holds keys, but you can lookup the object located at a
   given key). It has significantly reduced memory consumption versus the
-  builtin objects (1/2 the size of Set, 1/3rd the size of Dict). This will
-  be used as the interning structure for StaticTuple objects, as part of
-  an ongoing push to reduce peak memory consumption.  (John Arbash Meinel)
+  builtin objects (1/2 the size of Set, 1/3rd the size of Dict). This is
+  used as the interning structure for StaticTuple objects.
+  (John Arbash Meinel)
 
 * ``BTreeLeafParser.extract_key`` has been tweaked slightly to reduce
   mallocs while parsing the index (approx 3=>1 mallocs per key read).
   This results in a 10% speedup while reading an index.
   (John Arbash Meinel)
 
+* ``bzrlib._static_tuple_pyx.StaticTuple`` is now available. This class
+  functions similarly to ``tuple`` objects. However, it can only point at
+  other ``StaticTuple`` instances or strings. This allows us to remove it
+  from the garbage collector (it cannot be in a cycle), it also allows us
+  to intern the objects. In testing, this can reduce peak memory by
+  20-40%, and significantly improve performance by removing objects from
+  being inspected by the garbage collector. (John Arbash Meinel)
+
 * The ``bzrlib.lsprof`` module has a new class ``BzrProfiler`` which makes
   profiling in some situations like callbacks and generators easier.
   (Robert Collins)

=== modified file 'bzrlib/_static_tuple_c.c'
--- a/bzrlib/_static_tuple_c.c	2009-10-12 18:06:02 +0000
+++ b/bzrlib/_static_tuple_c.c	2009-10-12 18:14:21 +0000
@@ -167,7 +167,7 @@
 
 
 static PyObject *
-StaticTuple_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+StaticTuple_new_constructor(PyTypeObject *type, PyObject *args, PyObject *kwds)
 {
     StaticTuple *self;
     PyObject *obj = NULL;
@@ -623,7 +623,7 @@
     0,                                           /* tp_dictoffset */
     0,                                           /* tp_init */
     0,                                           /* tp_alloc */
-    StaticTuple_new,                             /* tp_new */
+    StaticTuple_new_constructor,                 /* tp_new */
 };
 
 



More information about the bazaar-commits mailing list