This is from the gcc-3_2-branch, which will be included in 3.2.3 if there ever is one (and the upcoming 3.3). It decreases the number of times the collector has to be run by increasing its memory workspace: --- gcc-3.2.2/gcc/ggc-page.c 2003-02-28 01:27:12.000000000 -0800 +++ gcc-3_2-branch/gcc/ggc-page.c 2002-01-05 14:11:21.000000000 -0800 @@ -346,9 +346,9 @@ one) before collection is performed. */ #define GGC_MIN_EXPAND_FOR_GC (1.3) -/* Bound `allocated_last_gc' to 16MB, to prevent the memory expansion +/* Bound `allocated_last_gc' to 4MB, to prevent the memory expansion test from triggering too often when the heap is small. */ -#define GGC_MIN_LAST_ALLOCATED (16 * 1024 * 1024) +#define GGC_MIN_LAST_ALLOCATED (4 * 1024 * 1024) /* Allocate pages in chunks of this size, to throttle calls to memory allocation routines. The first page is used, the rest go onto the
Sigh. I wish this thing had a preview/edit. That patch will make it worse. This is the right one: --- gcc-3.2.2/gcc/ggc-page.c 2003-02-28 01:27:12.000000000 -0800 +++ gcc-3_2-branch/gcc/ggc-page.c 2002-01-05 14:11:21.000000000 -0800 @@ -346,9 +346,9 @@ one) before collection is performed. */ -#define GGC_MIN_EXPAND_FOR_GC (1.3) +#define GGC_MIN_EXPAND_FOR_GC (2.0) -/* Bound `allocated_last_gc' to 16MB, to prevent the memory expansion +/* Bound `allocated_last_gc' to 32MB, to prevent the memory expansion test from triggering too often when the heap is small. */ -#define GGC_MIN_LAST_ALLOCATED (16 * 1024 * 1024) +#define GGC_MIN_LAST_ALLOCATED (32 * 1024 * 1024) /* Allocate pages in chunks of this size, to throttle calls to memory allocation routines. The first page is used, the rest go onto the
I see what went wrong. This patch listed from the 3.2.2-r1 ebuild has: # Update to support TLS and __thread epatch ${DISTDIR}/${P}-tls-update.patch.bz2 Which includes more than TLS and __thread. Presumably it comes from an older snapshot of 3-2_branch. It has a similar patch: --- gcc-3.2.2/gcc/ggc-page.c 2002-01-06 00:11:21.000000000 +0200 +++ gcc-3.2.2-20030218/gcc/ggc-page.c 2003-02-04 13:52:50.000000000 +0200 @@ -346,9 +346,9 @@ one) before collection is performed. */ #define GGC_MIN_EXPAND_FOR_GC (1.3) -/* Bound `allocated_last_gc' to 4MB, to prevent the memory expansion +/* Bound `allocated_last_gc' to 16MB, to prevent the memory expansion test from triggering too often when the heap is small. */ -#define GGC_MIN_LAST_ALLOCATED (4 * 1024 * 1024) +#define GGC_MIN_LAST_ALLOCATED (16 * 1024 * 1024) Which doesn't touch GGC_MIN_EXPAND_FOR_GC.
What is TLS anyway? Top Level Sources? If the TLS patch is merely a diff between 3.2.2 and an older snapshot of the 3.2_branch, then if its updated to be more recent, then the stuff I listed will be included. So far I've seen a 20-50% reduiction in compilation time, more gains on larger files.
Thread Local Storage ... needed for NPTL (linuxthreads2) support ...
Ah ok. Well the ggc-page patch makes a nice difference. I also think it's reasonable to expect that Gentooers have got more than 4 and 16mb of ram. : )
Added to 3.2.2-r2