Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!dogie.macc.wisc.edu!decwrl!sgi!shinobu!odin!warp.esd.sgi.com!kipp From: kipp@warp.esd.sgi.com (Kipp Hickman) Newsgroups: comp.sys.sgi Subject: Re: C++ and C Message-ID: <4556@odin.SGI.COM> Date: 26 Feb 90 18:04:58 GMT References: <205*doelz@urz.unibas.ch> Sender: news@odin.SGI.COM Reply-To: kipp@warp.esd.sgi.com (Kipp Hickman) Organization: Silicon Graphics, Entry Systems Division Lines: 18 We did some performance tests with C++, running the most recent version of the dhyrstone tests through the C++ compiler. The results were identical to the standard C numbers. We even tweaked the tests to use C++ language features and were able to improve the numbers. The trick with C++ is to use it "effectively". There are pieces of your code that aren't performance critical - you can use C++ fully here, without worry. Other sections of your code will be highly critical - use C++, but use it carefully, so that it is generating the same old fast C code. A good thing to avoid if you have a performance critical section is subroutines. (this is true for C too) The mips compilers will optimize the #@$(&#@&$ out of the code, as long as a subroutine isn't called (that way it knows it can safely put memory cells into registers, etc.). Hope this helps. kipp hickman silicon graphics inc.