From kde-core-devel Fri Mar 07 18:33:23 2003 From: Luis Pedro Coelho Date: Fri, 07 Mar 2003 18:33:23 +0000 To: kde-core-devel Subject: Re: glib dependancy in KDE3.x X-MARC-Message: https://marc.info/?l=kde-core-devel&m=104706222703176 Le Vendredi 7 Mars 2003 19:27, Guillaume Laurent a écrit : > On Friday 07 March 2003 19:15, Maks Orlovich wrote: > > Pointless use of virtual functions is of course wasteful. > > Last time I actually tried to measure how "wasteful" that was (repeated > calls to a function doing a sqrt(), virtual or not), I had to raise the > number of iterations to 1 million before there was any measurable > difference (about 1 second out of 20 or so). That was on a P-III 600 MHz. > > 'virtual' overhead will be drowned in statistic noise as soon as your > function is doing anything serious, like IO. Not to mention that your comparison involved virtual vs non-virtual calling of the same function. If you want the same functionallaty of virtual functions, they will be at least as cheap as any other alternative you can think of (pointers to functions, jump tables, switches, nested ifs etc.) Regards. -- Luis Pedro Coelho check out my game of hearts for the KDE at http://hearts.sf.net