From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,b87849933931bc93 X-Google-Attributes: gidfac41,public X-Google-Thread: 109fba,b87849933931bc93 X-Google-Attributes: gid109fba,public X-Google-Thread: f43e6,b87849933931bc93 X-Google-Attributes: gidf43e6,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,b87849933931bc93 X-Google-Attributes: gid1108a1,public X-Google-Thread: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public From: Corey Minyard Subject: Re: What is wrong with OO ? Date: 1997/01/12 Message-ID: #1/1 X-Deja-AN: 209467980 sender: minyard@wf-rch references: <5a0niaINNlda@topdog.cs.umbc.edu> <32C43AC8.24E2@sn.no> organization: Wonderforce Research newsgroups: comp.lang.c++,comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object,comp.software-eng Date: 1997-01-12T00:00:00+00:00 List-Id: > Assembler will ALWAYS be the most efficient language. The more you > abstract the problem, the more you "generalize" the solution to a > given problem, the more you necessarily give up in efficiency. C > takes a minimal 3x hit on integer arithmetic, 10x on more complex > stuff; and OO, because of the overhead interpreting where > to send things, is 10x on top of that. These numbers are completely bogus for modern compilers. There have been documented cases where compiled code has actually produced faster code than an experienced human writing assembler. See the ammunition section at http://www.adahome.com. I would expect the numbers for a compiler would improve with a complex system. Two factors contribute to this. Modern optimizing compilers can do global optimization far beyond what a human could ever do. This is why I expect compilers to do better than humans for complex systems. The other is the state of modern processors. In the old days, processors were very simple and so were compilers. Now, processors have big pipelines, tons of registers, lots of little tricky speed optimizations, lots of condition code registers, etc. I have done pipeline and register optimization in assembly language for small routines (50-200 instructions for TMS320C40); it is enough to make your head hurt. Although the routines where better than could be produced by a compiler (they HAD to be fast), they took an extremely long time to write. You can spend all day optimizing and debugging 100 instructions. With VLIW coming, humans optimization anything that is not dirt simple is just simply not feasible. A compiler will always do a better job. And the OO hit is not 10x. I have seen numbers on that for C and C++; although I don't remember them exactly they were in the 20-30% range. -- Corey Minyard Internet: minyard@acm.org Work: minyard@nortel.ca UUCP: minyard@wf-rch.cirr.com