Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!xanadu!roger From: roger@xanadu.com (Roger Gregory) Newsgroups: comp.object Subject: Re: Performance of Smalltalk vs C (or C++) Message-ID: <1991Feb8.192428.10073@xanadu.com> Date: 8 Feb 91 19:24:28 GMT References: <2961.279ffcba@iccgcc.decnet.ab.com> <3282@sequent.cs.qmw.ac.uk> <2995.27a59704@iccgcc.decnet.ab.com> Organization: Xanadu Operating Company Lines: 41 Unfortunately I don't have any good numbers at this point. We currently have about 60K lines of smalltalk and a translator that turns it into about 200K lines of c++. I have posted about the translator to the c++ groups, and can forward that message, or post it here. Currently the c++ has all kinds of inefficient stuff in it, as we havn't started with performance tuneing yet, I expect to use 2 major kinds of heuristics to speed things up: casheing and inlines. Cashes will speed up the smalltalk equivalently, inlines will only affect the C++, right now the C++ and smalltalk run at about the same speed, but the C++ has -> overloaded (for gc) and thus does 3 (3 !) function calls per -> , this will of course be inlined away with some improvement in speed. I'll post some numbers after we reach that phase. The interesting thing about our code is that the exact same code can be profiled in both enviornments, thus speed improvments can be added to the source and not cause the versions in C++ & Smalltalk to diverge. This can be a major impediment to comparison, even with a translator, certain implementation decesions that may cause a differential between performance in the two languages. In most cases we are able to hide the implementation details low enough that we can do the right thing in each language. We have deliberately refrained from doing any implementation tuneing and confined ourselves to algormithmic speedups believing that "premature optimization is the root of all evil" (Knuth?) Our code is currently optimized to be eaisy to understand and change, which should make it eaisy to change to run faster. What little speedup has been attempted is mostly to make the smalltalk tests run faster, to speed the development and debugging phases. -- Roger Gregory Xanadu Operating Company (415) 856-4112 x113 roger@xanadu.com