[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r14341: The optimist calls the glass half full. The pessimist calls (in tor/trunk: . src/common)



Author: nickm
Date: 2008-04-09 21:44:23 -0400 (Wed, 09 Apr 2008)
New Revision: 14341

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/src/common/container.c
Log:
 r19283@catbus:  nickm | 2008-04-09 21:44:18 -0400
 The optimist calls the glass half full.  The pessimist calls it half empty.  The engineer says it is twice as large as it needs to be.  In this case, the engineer says that the default smartlist size is twice as large as it needs to be and wouldn't it be nice to save half a megabyte with a one-line patch?



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r19283] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2008-04-09 21:21:45 UTC (rev 14340)
+++ tor/trunk/ChangeLog	2008-04-10 01:44:23 UTC (rev 14341)
@@ -26,6 +26,8 @@
     - Make relay cells written on a connection count as non-padding when
       tracking how long a connection has been in use. Bugfix on
       0.2.0.1-alpha.  Spotted by lodger.
+    - Reduce the default smartlist size from 32 to 16; it turns out that
+      most smartlists hold around 8-12 elements tops.
 
   o Minor features:
     - Allow separate log levels to be configured for different logging

Modified: tor/trunk/src/common/container.c
===================================================================
--- tor/trunk/src/common/container.c	2008-04-09 21:21:45 UTC (rev 14340)
+++ tor/trunk/src/common/container.c	2008-04-10 01:44:23 UTC (rev 14341)
@@ -30,7 +30,7 @@
 #include "ht.h"
 
 /** All newly allocated smartlists have this capacity. */
-#define SMARTLIST_DEFAULT_CAPACITY 32
+#define SMARTLIST_DEFAULT_CAPACITY 16
 
 /** Allocate and return an empty smartlist.
  */