Xref: utzoo comp.lang.c++:12024 comp.object:2649 Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!radar!cadillac!dsouza From: dsouza@gwen.cad.mcc.com (Desmond Dsouza) Newsgroups: comp.lang.c++,comp.object Subject: Re: Static typing and OOP efficiency Message-ID: Date: 5 Mar 91 04:57:15 GMT References: <1991Feb16.121825.15353@gpu.utcs.utoronto.ca> <11545@pasteur.Berkeley.EDU> Sender: news@cadillac.CAD.MCC.COM Organization: MCC CAD Program, Austin, Texas Lines: 35 In-reply-to: jbuck@galileo.berkeley.edu's message of 28 Feb 91 23:39:25 GMT In article <11545@pasteur.Berkeley.EDU> jbuck@galileo.berkeley.edu (Joe Buck) writes: > |> When you write a library in C++ you tend to make everything virtual that > |> can plausibly be, just in case. The people at AT&T did not make certain > |> things virtual in the 'iostream' library and a lot of people are unhappy > |> about that. > > Only people who don't understand the design. They'd be even more unhappy > if the functions were virtual because they'd get function calls per > character of I/O. > hoelzle@Neon.Stanford.EDU (Urs Hoelzle) writes: > This proves that, at least in principle, your assertion is incorrect. > Now, I'm not claiming that dynamically-dispatched calls are always > faster in untyped languages, or even that they are faster on average. > What I am saying is that dynamically-dispatched calls can be faster > than C++ virtual function calls *as they are implemented today*. C++ > could actually benefit from the same optimization techniques that the > Self compiler uses. The Self compiler technique of 'customizing' (OOPSLA '89) seems like it could really eliminate *much* of the overhead of virtual functions. Doug Lea's paper in Usenix/C++ 90 described it well, if you are interested. -- Desmond. -- ------------------------------------------------------------------------------- Desmond D'Souza, MCC CAD Program | ARPA: dsouza@mcc.com | Phone: [512] 338-3324 Box 200195, Austin, TX 78720 | UUCP: {uunet,harvard,gatech,pyramid}!cs.utexas.edu!milano!cadillac!dsouza