Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news4.ner.bbnplanet.net!news3.near.net!paperboy.wellfleet.com!news-feed-1.peachnet.edu!usenet.eel.ufl.edu!news.mathworks.com!uunet!in1.uu.net!cs.utexas.edu!howland.reston.ans.net!torn!nott!cunews!dbuck
From: dbuck@superior.carleton.ca (Dave Buck)
Subject: Re: Smalltalk vs C vs C++ benchmark results
X-Nntp-Posting-Host: superior.carleton.ca
Message-ID: <DEM9Jn.HwD@cunews.carleton.ca>
Sender: news@cunews.carleton.ca (News Administrator)
Organization: Carleton University, Ottawa, Canada
References: <DEDsF1.3I8@cunews.carleton.ca> <knight.810307251@tina.mrco.carleton.ca> <42mvrt$13hr@watnews1.watson.ibm.com> <42otu5$aag@aadt.sdt.com>
Date: Sat, 9 Sep 1995 02:28:35 GMT
Lines: 23

In article <42otu5$aag@aadt.sdt.com>, Larry E. Baker <leb@sdt.com> wrote:
>Final Comment: if you want to compare apples to apples, WRT C++,
>C, and FORTRAN, make sure all C/C++ variables are static or
>global (thus allocated once and never again), pass *everything*
>as a pointer (C++ & parameter, or C & operator), and
>*never* use malloc(), new, free() or delete.  I expect that
>the results will then become very similar.

Of course the result of such a test shows you nothing about the object
oriented nature of C++.  If you want a test that's realistic for an OO
system, you must allocate all your objects using new and delete.
Variables should be instance variables (data members) referenced
through pointers.  Then, the results for C++ will be comparable to
Smalltalk and quite possibly slower.

David Buck
dbuck@ccs.carleton.ca

_________________________________
| David K. Buck                 |
| dbuck@ccs.carleton.ca         |
| The Object People             |
|_______________________________|
