Canonical type nodes, or, comptypes considered harmful

Mike Stump mrs@apple.com
Wed Nov 8 08:13:00 GMT 2006


On Nov 7, 2006, at 7:09 PM, Dale Johannesen wrote:
> I do understand the advantages of sharing them more.  Perhaps some  
> 90% solution could be made to work, with most type nodes being  
> unified and the problem cases (there would not be any in C++,  
> apparently) using the existing inefficient mechanisms.

Unfortunately, I suspect it has to be nearly perfect to get the  
benefit (compile time), anything less, and all it does is save memory  
and increase compile time.  While saving memory is good by itself,  
this would a a project, that if started, you'd really want to press  
forward and finish.

I can dig out actual real live numbers, if you're curious.  For  
example, when calling comptypes, the no answers are (were) 34x more  
likely than yes answers.  If you cannot return false immediately when  
point_to_type1 != pointer_to_type2, you then have to run a structural  
equality tester, and once you do that, you spend 120ns per depth in  
the tree as you fault everything into cache, what's that 300 some  
instructions.  21,980 were fast, 336,523 were slow, the slow path  
dominated.

Now, I'd love to be proven wrong.



More information about the Gcc mailing list