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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,c52c30d32b866eae X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,2ea02452876a15e1 X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,c52c30d32b866eae X-Google-Attributes: gid1108a1,public From: mbk@caffeine.engr.utk.edu (Matt Kennel) Subject: Re: Real OO Date: 1996/04/08 Message-ID: <4kbl7r$1i8@gaia.ns.utk.edu>#1/1 X-Deja-AN: 146398141 references: <65lDeVZF3RB@herold.franken.de> followup-to: comp.lang.eiffel,comp.lang.ada,comp.object organization: University of Tennessee, Knoxville and Oak Ridge National Laboratory reply-to: kennel@msr.epm.ornl.gov newsgroups: comp.lang.eiffel,comp.lang.ada,comp.object Date: 1996-04-08T00:00:00+00:00 List-Id: Don Harrison (donh@syd.csa.com.au) wrote: : To get a real idea of (theoretical) relative performance of dynamic binding : compared to static binding, you need to know: : 1) What is the relative performance of indirect calls as a fraction of the : performance of direct calls. Are they 50% as efficient?, 40%?, 60%?, 70%?. : 2) Are the above statistics (for C++?) the same for Eiffel and Ada? My experience with Sather numerical classes is that the cost of indirect calls is not the actual indirection, but the lost opportunities for inlining. If you can do enough repeated inlining (i.e. inlining of routines exposes new concretized calls which are further inlined and substantial constant and data propagation) you can get very large speed improvements in some circumstances. Matrix classes are the canonical example: any remaining indirection anywhere in the chain can completely blow performance compared to the standard algorithm. I believe the Sather compiler itself has fewer than 10% of its call points dispatched. (this is a static, not dynamic count). Among all compilation options, turning inlining on and off has the greatest observed effect on resulting execution speed. : ----- : Hardware is out of my depth but what I'm wondering is whether the hardware could : optimise by determining the indirection ahead of time so that the indirect call : is effectively reduced to a direct one. If this were possible for 100% of calls : (which I doubt), there would be no performance penalty for dynamic binding. No I don't believe so, you really want to have a real compiler do its optimization tricks to get best use of static calls. : Don. cheers Matt