Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!yale!cmcl2!lanl!beta.lanl.gov.!mikeg From: mikeg@c3.c3.lanl.gov (Michael P. Gerlek) Newsgroups: comp.lang.c++ Subject: Re: Seeking critique(s) of C++ Message-ID: Date: 24 Mar 91 17:41:26 GMT References: <1991Mar20.015750.9487@dbase.A-T.COM> <633@taumet.com> Sender: news@lanl.gov Organization: Los Alamos National Laboratory, New Mexico Lines: 40 In-reply-to: steve@taumet.com's message of 23 Mar 91 19:50:48 GMT In article <633@taumet.com> steve@taumet.com (Stephen Clamage) writes: > C++ typically involves less overhead to accomplish the same task than > C, especially if you are using a compiler which goes directly to > object code rather than via C intermediate code. I cite as an example > a project of our own of about 30,000 lines of source code which we are > converting from C to C++. We have converted all the string processing > to use carefully designed string and storage- management classes, and > achieved a 20% reduction in both source and object code size. We > haven't measured the runtime improvement precisely, but the code is > faster. The operations we do could be simulated in C code, but the C > code would be very hard to understand, use, debug, and modify. The > C++ code is very straightforward. I've just started playing with C++, and keep hearing that "they say" C++ won't cut it for codes where performance issues are critical, so I'm happy to hear "they" may be wrong. So... Leaving aside issues of how hard the C code would be to understand, maintain, debug, etc, does anyone have any details or references on just how much more efficient C++ code is over C? - runtime peformance, source/object code size, and so on? Do Stephen's claims really hold true using a compiler that *does* go through intermediate code? At first blush this doesn't seem intuitive. (A "tight" piece of C++ code has to be translated into a "tight-with-overhead" piece of C code. What does the "overhead" consist of?) Finally, Stephen says his string processing uses "carefully designed" management classes. How "careful" need one be in order to exceed the source and object code size of a traditional C program? I'm sure this is largely FAQ stuff, but any pointers would be appreciated. -- -[mpg] mikeg@lanl.gov "Hell on (two) wheels."