🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c++
Article #354

Re: Re.: C++ preprocessor wanted

#354
From: John Gilmore
Date: Fri, 17 Oct 1986 10:20
21 lines
1494 bytes
> >                        ...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; 0<i; i--) p->f();
> 
> 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!
Technical Details
Message-ID: <1197@hoptoad.uucp>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!lll-crg!hoptoad!gnu
References: <6174@alice.uUCp>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!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