Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!tut!tukki.jyu.fi!sakkinen From: sakkinen@tukki.jyu.fi (Markku Sakkinen) Newsgroups: comp.lang.c++ Subject: Re: Borland Turbo C++ performance issue and tutorial errors Message-ID: <1990Aug17.123657.8747@tukki.jyu.fi> Date: 7 Aug 90 06:55:58 GMT References: <7921@tekgvs.LABS.TEK.COM> <380@taumet.com> Reply-To: sakkinen@jytko.jyu.fi (Markku Sakkinen) Organization: University of Jyvaskyla, Finland Lines: 54 Note2: Third trial to post! Note1: This is the second posting of an article that apparently disappeared while the news software was out of order here for three days. Sorry if somebody receives it twice. In article <380@taumet.com> steve@taumet.com (Stephen Clamage) writes: >toma@tekgvs.LABS.TEK.COM (Tom Almy) writes: > >|It has already been pointed out that Turbo C++ is slower compiling a C program >|that Turbo C V2.0. But the problem gets worse with C++ programs [...] >| ... >You have to be very careful in such comparisons. Any C++ program >using streams includes the entire stream i/o package, which is very >large. It has much more functionality than does printf(), so it is >bigger. [...] > ... Right! Often in the newsgroups people claim that Ada code is much larger and slower and C code, when they get in the Ada programmes a lot of run-time support unheard of in the C world, e.g. array bounds checking. >|The calc program example from the Stroustrup book (with addition of trig >|functions) compiles to a 35440 byte file, while the same program rewritten >|in JPI Modula-2 (just to test it out) is 11510. (The source file in C++ is >|60% the size, though!). > >There can be no validity to a claim that two programs written in two >different programming languages are the "same". It is a well-known >theorem in the theory of computation that one cannot *in general* >determine whether two programs have the same behavior. This is a dangerous fallacy. Although the *general* problem is undecidable, it is in many particular cases possible to prove that two programmes are (or are not) equivalent. Of course, the problem is much more difficult when the programming languages are different; especially if one of the languages has as irregular and fuzzily defined semantics as C and its derivatives. (Without seeing the source code, we cannot guess how much it was "the same program" in the quoted case, of course.) > ... >IMHO, comparing executable file size for toy programs is an entirely >irrelevant exercise. [...] > ... Here I agree wholeheartedly! Markku Sakkinen Department of Computer Science University of Jyvaskyla (a's with umlauts) Seminaarinkatu 15 SF-40100 Jyvaskyla (umlauts again) Finland SAKKINEN@FINJYU.bitnet (alternative network address)