Re: [Geekos-devel] first release of experimental version
Status: Pre-Alpha
Brought to you by:
daveho
From: David H. <da...@cs...> - 2002-03-11 17:09:49
|
On Mon, Mar 11, 2002 at 10:35:01AM -0600, Parc wrote: > On Mon, Mar 11, 2002 at 11:15:14AM -0500, David Hovemeyer wrote: > [snip] > > is a clear benefit. I want to avoid over-use of C++ features, > > especially constructors and destructors (which can cause major > > performance overheads if used carelessly). > > What? Constructors and destructors don't cause performance overhead. > You can't avoid calling ctors/dtors. Right, I wasn't very specific. What I meant was "constructors and destructors implicitly called for objects used by value", especially for hidden temporaries. I have seen this become a huge source of overhead in C++ programs. I've conciously avoided using the dynamic "new" and "delete" operators, so we can completely avoid automatic calls to constructors and destructors made by the compiler. (These calls can be made explicitly as needed.) > Perhaps what you intended to say was virtual functions? Those would > cause some significant overhead. Yes, there is some overhead associated with virtual function calls. However, they are exactly equivalent to calling a function through a table of function pointers, and every OS kernel I have seen uses this technique. -Dave |