PATCH: change template info representation in g++

Mike Stump
Wed Apr 19 18:58:00 GMT 2006

On Apr 18, 2006, at 6:12 PM, Sandra Loosemore wrote:
> I have been commissioned

We don't usually talk about money here...  :-)

> to hack on some memory usage improvements in gcc, in particular  
> replacing uses of TREE_LIST for things that aren't really lists  
> with more compact data structures.

Sounds good.

Patch looks good.

A couple of questions...  What does it do for compile times (say,  
compiling QT or something of that ilk) on a release style-checking - 
O2 built compiler?  My reading of it is that it should be about the  
same speed, but, I do wonder if it is.

Also, what's the change in total memory allocated and/or peak memory  
in use?  You can use:

   --enable-gather-detailed-mem-stats         enable detailed memory  
allocation stats gathering

and compile with -Q as I recall to get the memory information.  Off- 
hand, it looks to be about a 50% savings in memory on the  
datastructure, though, you can get it to 75% savings if you can move  
the single bit for pending_template out into struct lang_type_class  
and struct lang_decl_flags.

I do wonder if it is more profitable to just move all the data into  
the parent structure and do away with the extra pointer entirely.   
Did you consider or try that?

More information about the Gcc-patches mailing list