This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Using C++ in GCC is OK


On Mon, May 31, 2010 at 09:44:08AM -0700, Mark Mitchell wrote:
> >> I just really hope we will have strict criteria that any transition will  
> >> not make compiler slower and will not increase compiler build time.
> > 
> > Nor will grow the memory footprint, at least of the important data
> > structures, or increase maintanance costs by making the code less readable,
> > etc.
> 
> There is no reason that use of C++ should increase the memory footprint
> of the compiler, make the compiler slower, or make the code less
> readable.  Poor use of C++ might lead to those things; good use will
> not.  That is why we need coding standards and patch review.

E.g. when you start using virtual methods, suddenly you need a vtable
pointer in the object and thus the object grew by 8 bytes.
In many cases it would be really addition of that pointer, dropping an 8/16
bit code would slow things down too much (using virtual method to get you
say enum tree_code from a tree would be way too slow, similarly for rtti).

Similarly if the compiler massively starts using virtual methods everywhere,
there will be slow downs caused by the increased number of harder to predict
indirect calls.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]