diff mbox

[2/7] diet: use smaller LIST_NODE_NR (29 -> 13)

Message ID 20170629051646.35988-3-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show

Commit Message

Luc Van Oostenryck June 29, 2017, 5:16 a.m. UTC
Currently the size of the array used for ptrlist is 29.
However, some inspection shows that the mean size of ptrlists
is much smaller: around 2.5 - 5 only. This means that most memory
allocated for ptrlists are never used.

Change this by changing the size to the conservative value of 13.
With this value, on some test programs, memory used for ptrlists
is only 43% - 48% smaller or 24% - 28% for the total memory.
This difference in memory consumption allow also to win some time:
5 - 7% in the conditions used for the test but YMMV.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 ptrlist.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/ptrlist.h b/ptrlist.h
index d09be2f51..b605bb858 100644
--- a/ptrlist.h
+++ b/ptrlist.h
@@ -22,7 +22,7 @@ 
  */
 #define MKTYPE(head,expr)		({ (TYPEOF(head))(expr); })
 
-#define LIST_NODE_NR (29)
+#define LIST_NODE_NR (13)
 
 struct ptr_list {
 	int nr;