Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-crg!hoptoad!gnu From: gnu@hoptoad.uucp (John Gilmore) Newsgroups: net.lang.c++,net.micro.atari16 Subject: Re: Re.: C++ preprocessor wanted Message-ID: <1197@hoptoad.uucp> Date: Fri, 17-Oct-86 06:20:14 EDT Article-I.D.: hoptoad.1197 Posted: Fri Oct 17 06:20:14 1986 Date-Received: Fri, 17-Oct-86 22:16:26 EDT References: <6174@alice.uUCp> Organization: Nebula Consultants in San Francisco Lines: 21 Xref: mnetor net.lang.c++:377 net.micro.atari16:2563 > > ...you get inheritance and even late binding > > of sorts with high efficiency (about 100 microSecs for a typical > > invocation of a method). In article <6174@alice.uUCp>, bs@alice.UucP (Bjarne Stroustrup) writes: > This made me curious about what the cost of a C++ virtual function call > really is so I ran this example on a VAX11/750: > > for (int i = 100000; 0f(); > > It took 4 seconds; that is, about 4 microseconds per iteration. Uh, if you run a loop 100,000 times in 4 seconds, that is *40* microseconds per iteration, which sounds a lot more reasonable on a 750. Remember that this time includes the loop overhead, a function call, and a function return, and Vaxes are slow about function calls. Scale all the other "per iteration" numbers by a factor of 10 too. -- John Gilmore {sun,ptsfa,lll-crg,ihnp4}!hoptoad!gnu jgilmore@lll-crg.arpa (C) Copyright 1986 by John Gilmore. May the Source be with you!